diff --git a/jquery.pin.js b/jquery.pin.js index 2f675ef..7e43198 100644 --- a/jquery.pin.js +++ b/jquery.pin.js @@ -44,11 +44,19 @@ if (disabled) { return; } scrollY = $window.scrollTop(); - + + var elmts = []; for (var i=0, len=elements.length; i data.end) { @@ -73,6 +81,7 @@ if (options.activeClass) { $this.removeClass(options.activeClass); } } } + elements = elmts; }; var update = function () { recalculateLimits(); onScroll(); }; @@ -96,4 +105,4 @@ return this; }; -})(jQuery); \ No newline at end of file +})(jQuery);