Skip to content

Commit a61d9c5

Browse files
committed
- Solved problem with active slides when using continuousVertical option. alvarotrigo#700
1 parent da67b66 commit a61d9c5

File tree

2 files changed

+54
-39
lines changed

2 files changed

+54
-39
lines changed

jquery.fullPage.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* fullPage 2.2.5.2
2+
* fullPage 2.2.6
33
* https://github.com/alvarotrigo/fullPage.js
44
* MIT licensed
55
*
@@ -676,6 +676,16 @@
676676
landscapeScroll(slides, destiny);
677677
}
678678

679+
/**
680+
* Maintains the active slides in the viewport
681+
* (Because he `scroll` animation might get lost with some actions, such as when using continuousVertical)
682+
*/
683+
function keepSlidesPosition(){
684+
$('.fp-slide.active').each(function(){
685+
silentLandscapeScroll($(this));
686+
});
687+
}
688+
679689
function scrollPage(element, callback, isMovementUp){
680690
var scrollOptions = {}, scrolledElement;
681691
var dest = element.position();
@@ -715,6 +725,9 @@
715725
// Maintain the displayed position (now that we changed the element order)
716726
silentScroll($('.fp-section.active').position().top);
717727

728+
// Maintain the active slides visible in the viewport
729+
keepSlidesPosition();
730+
718731
// save for later the elements that still need to be reordered
719732
var wrapAroundElements = activeSection;
720733

@@ -759,6 +772,9 @@
759772
}
760773

761774
silentScroll($('.fp-section.active').position().top);
775+
776+
// Maintain the active slides visible in the viewport
777+
keepSlidesPosition();
762778
};
763779

764780

0 commit comments

Comments
 (0)