[英]fullpage.js silentMoveTo doesn't seem to work?
我正在創建一個 fullpage.js 站點,我需要在其中滾動幻燈片以查看特定幻燈片。 像這樣:
1
X2X
3
4
X2X 是 3 張幻燈片,我想降落在第二張幻燈片上,以便用戶可以向左或向右移動。
我正在使用OnLeave
調用silentMoveTo
但無論我做什么似乎都沒有生效:
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);
}
}
但是silentMoveTo
不起作用。 這是一個 CodePen https://codepen.io/thetwopct/pen/bZwyRw
關於我做錯了什么的任何提示?
不需要通過 OnLeave/silentMoveTo 執行此操作,只需將active
類添加到我想顯示的幻燈片即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.