I'm creating a fullpage.js site where I need to have the slides scroll in to view on a particular slide. Like this:
1
X2X
3
4
Where X2X is 3 slides, I want to land on the 2nd one so user can go left or right.
I am using OnLeave
to call silentMoveTo
but whatever I do doesn't seem to take effect:
onLeave: function(origin, destination, direction) {
var params = {
origin: origin,
destination: destination,
direction: direction
};
//after leaving first section
console.log("leaving...");
if (origin.index == 0 && direction == "down") {
// moves the slides to the 2nd slide
console.log("fire after 1?");
fullpage_api.silentMoveTo(1, 1);
}
}
But silentMoveTo
doesn't work. Here's a CodePen https://codepen.io/thetwopct/pen/bZwyRw
Any tips to what I am doing wrong?
Didn't need to do this via OnLeave/silentMoveTo, just add active
class to the slide I wanted to show.
As per https://github.com/alvarotrigo/fullPage.js/issues/522
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.