We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b24657b + 0258ee0 commit 7eb3d74Copy full SHA for 7eb3d74
jquery.pin.js
@@ -44,11 +44,19 @@
44
if (disabled) { return; }
45
46
scrollY = $window.scrollTop();
47
-
+
48
+ var elmts = [];
49
for (var i=0, len=elements.length; i<len; i++) {
50
var $this = $(elements[i]),
- data = $this.data("pin"),
51
- from = data.from,
+ data = $this.data("pin");
52
53
+ if (!data) { // Removed element
54
+ continue;
55
+ }
56
57
+ elmts.push($this);
58
59
+ var from = data.from,
60
to = data.to;
61
62
if (from + $this.outerHeight() > data.end) {
@@ -73,6 +81,7 @@
73
81
if (options.activeClass) { $this.removeClass(options.activeClass); }
74
82
}
75
83
84
+ elements = elmts;
76
85
};
77
86
78
87
var update = function () { recalculateLimits(); onScroll(); };
@@ -96,4 +105,4 @@
96
105
97
106
return this;
98
107
99
-})(jQuery);
108
+})(jQuery);
0 commit comments