Skip to content

Commit 00c77d0

Browse files
committed
Update jquery.slimscroll.js
Inside the attach, this is the Window object, not the DOM container, this could cause the page scroll blocked, because the _onWheel still being used to process the page scroll event while the slimscroll container has been destroyed.
1 parent c1d1c79 commit 00c77d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jquery.slimscroll.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
}
310310

311311
// attach scroll events
312-
attachWheel();
312+
attachWheel(this);
313313

314314
function _onWheel(e)
315315
{
@@ -382,12 +382,12 @@
382382
hideBar();
383383
}
384384

385-
function attachWheel()
385+
function attachWheel(target)
386386
{
387387
if (window.addEventListener)
388388
{
389-
this.addEventListener('DOMMouseScroll', _onWheel, false );
390-
this.addEventListener('mousewheel', _onWheel, false );
389+
target.addEventListener('DOMMouseScroll', _onWheel, false );
390+
target.addEventListener('mousewheel', _onWheel, false );
391391
}
392392
else
393393
{

0 commit comments

Comments
 (0)