Skip to content

Commit 9feb3d6

Browse files
committed
- Fixed bug: prevent iScroll from scrolling in inactive sections alvarotrigo#2290
1 parent 4a462d4 commit 9feb3d6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jquery.fullPage.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,7 @@
14291429

14301430
stopMedia(v.activeSection);
14311431

1432+
options.scrollOverflowHandler.beforeLeave();
14321433
element.addClass(ACTIVE).siblings().removeClass(ACTIVE);
14331434
lazyLoad(element);
14341435
options.scrollOverflowHandler.onLeave();
@@ -2907,6 +2908,11 @@
29072908
}
29082909
},
29092910

2911+
// Turns off iScroll for the leaving section
2912+
beforeLeave: function(){
2913+
iscrollHandler.onLeave()
2914+
},
2915+
29102916
// Turns on iScroll on section load
29112917
afterLoad: function(){
29122918
var scroller = $(SECTION_ACTIVE_SEL).find(SCROLLABLE_SEL).data('iscrollInstance');
@@ -2936,6 +2942,10 @@
29362942

29372943
iScrollInstance = new IScroll($this.get(0), iscrollOptions);
29382944
iscrollHandler.iScrollInstances.push(iScrollInstance);
2945+
2946+
//off by default until the section gets active
2947+
iScrollInstance.wheelOff();
2948+
29392949
$this.data('iscrollInstance', iScrollInstance);
29402950
});
29412951
},

0 commit comments

Comments
 (0)