diff --git a/src/definitions/modules/sticky.js b/src/definitions/modules/sticky.js index 5c2ea1bd8..a3fc7ed84 100644 --- a/src/definitions/modules/sticky.js +++ b/src/definitions/modules/sticky.js @@ -347,6 +347,9 @@ $.fn.sticky = function(parameters) { }, scroll: function(scroll) { module.debug('Setting scroll on element', scroll); + if(module.elementScroll == scroll) { + return; + } if( module.is.top() ) { $module .css('bottom', '') @@ -418,10 +421,6 @@ $.fn.sticky = function(parameters) { elementVisible = (element.height !== 0) ; - // save current scroll for next run - module.save.lastScroll(scroll.top); - module.save.elementScroll(elementScroll); - if(elementVisible) { if( module.is.initialPosition() ) { @@ -487,6 +486,10 @@ $.fn.sticky = function(parameters) { } } } + + // save current scroll for next run + module.save.lastScroll(scroll.top); + module.save.elementScroll(elementScroll); }, bindTop: function() {