From 0258ee00b7e8c5bcaa9d35241706709988f249c6 Mon Sep 17 00:00:00 2001 From: cchantep Date: Thu, 14 Nov 2013 14:31:03 +0100 Subject: [PATCH] Workaround for removed elements --- jquery.pin.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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);