tencent.jquery.pix.component 1.0.65 → 1.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -127,6 +127,7 @@ Waterfall.prototype.init = function () {
|
|
|
127
127
|
const self = this;
|
|
128
128
|
const options = this.options;
|
|
129
129
|
const $container = $(options.container);
|
|
130
|
+
const $scrollDom = options.scrollDom ? $(options.scrollDom) : $container;
|
|
130
131
|
|
|
131
132
|
this.nodePool = []; // DOM 节点池
|
|
132
133
|
this.activeNodes = new Map(); // 当前活跃节点(索引 -> DOM)
|
|
@@ -153,7 +154,7 @@ Waterfall.prototype.init = function () {
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
// 绑定滚动事件(节流处理)
|
|
156
|
-
$
|
|
157
|
+
$scrollDom.off().on('scroll', function () {
|
|
157
158
|
self.scrollTop = $(this).scrollTop();
|
|
158
159
|
|
|
159
160
|
window.requestAnimationFrame(() => {
|
|
@@ -165,7 +166,7 @@ Waterfall.prototype.init = function () {
|
|
|
165
166
|
}
|
|
166
167
|
});
|
|
167
168
|
|
|
168
|
-
this.scrollTop = $
|
|
169
|
+
this.scrollTop = $scrollDom.scrollTop(); // 当前滚动位置
|
|
169
170
|
|
|
170
171
|
// 首次渲染
|
|
171
172
|
self.updateVisibleItems();
|