Skip to content

Commit 92aa4bb

Browse files
committed
- Fixed bug when resizing the viewport
- Added new callback `afterResponsive`
1 parent bf803be commit 92aa4bb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

jquery.fullPage.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* fullPage 2.8.4
2+
* fullPage 2.8.5
33
* https://github.com/alvarotrigo/fullPage.js
44
* @license MIT licensed
55
*
@@ -176,7 +176,8 @@
176176
afterResize: null,
177177
afterReBuild: null,
178178
afterSlideLoad: null,
179-
onSlideLeave: null
179+
onSlideLeave: null,
180+
afterResponsive: null
180181
}, options);
181182

182183
//flag to avoid very fast sliding for landscape sliders
@@ -485,13 +486,15 @@
485486
FP.setFitToSection(false, 'internal');
486487
$(SECTION_NAV_SEL).hide();
487488
$body.addClass(RESPONSIVE);
489+
$.isFunction( options.afterResponsive ) && options.afterResponsive.call( container, active);
488490
}
489491
}
490492
else if(isResponsive){
491493
FP.setAutoScrolling(originals.autoScrolling, 'internal');
492494
FP.setFitToSection(originals.autoScrolling, 'internal');
493495
$(SECTION_NAV_SEL).show();
494496
$body.removeClass(RESPONSIVE);
497+
$.isFunction( options.afterResponsive ) && options.afterResponsive.call( container, active);
495498
}
496499
};
497500

@@ -1327,7 +1330,7 @@
13271330

13281331
/**
13291332
* Maintains the active slides in the viewport
1330-
* (Because he `scroll` animation might get lost with some actions, such as when using continuousVertical)
1333+
* (Because the `scroll` animation might get lost with some actions, such as when using continuousVertical)
13311334
*/
13321335
function keepSlidesPosition(){
13331336
$(SLIDE_ACTIVE_SEL).each(function(){
@@ -1911,7 +1914,11 @@
19111914
};
19121915
v.xMovement = getXmovement(v.prevSlideIndex, v.slideIndex);
19131916

1914-
canScroll = false;
1917+
//important!! Only do it when not resizing
1918+
if(!v.localIsResizing){
1919+
//preventing from scrolling to the next/prev section when using scrollHorizontally
1920+
canScroll = false;
1921+
}
19151922

19161923
if(options.onSlideLeave){
19171924

0 commit comments

Comments
 (0)