From 1a187da8c0139b88e5626d7cfbfbe3b6f7d29824 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Wed, 12 Jul 2017 12:52:48 +0200 Subject: [PATCH 1/2] Use element in place of .parent() for scroll position, fixing #19 --- animatescroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/animatescroll.js b/animatescroll.js index defc43f..2dd276e 100644 --- a/animatescroll.js +++ b/animatescroll.js @@ -159,7 +159,7 @@ } else { // Scroll the element to the desired position - $(opts.element).stop().animate({ scrollTop: this.offset().top - this.parent().offset().top + this.parent().scrollTop() - opts.padding}, opts.scrollSpeed, opts.easing); + $(opts.element).stop().animate({ scrollTop: this.offset().top - $(opts.element).offset().top + $(opts.element).scrollTop() - opts.padding}, opts.scrollSpeed, opts.easing); } setTimeout(function() { @@ -180,4 +180,4 @@ element:"html,body" }; -}(jQuery)); \ No newline at end of file +}(jQuery)); From 5d32c106183d905a50c33d72339892653bd51b33 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Wed, 12 Jul 2017 12:56:02 +0200 Subject: [PATCH 2/2] Minify issue on concat script moving () --- animatescroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animatescroll.js b/animatescroll.js index 2dd276e..b2ff57e 100644 --- a/animatescroll.js +++ b/animatescroll.js @@ -180,4 +180,4 @@ element:"html,body" }; -}(jQuery)); +})(jQuery);