fullscreenJS moveTo 方法不正确的视图
fullscreenJS moveTo method incorrect View
我在业余项目中使用 FullscreenJS,但在使用提供的 moveTo 方法时遇到问题。
moveTo 正在启动,锚点显示正确的幻灯片,但视图没有改变,它仍然在第一部分。
$.fn.fullpage.moveTo('firstSlides');
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'firstSlides'],
完整定义。
$('#fullpage').fullpage({
navigation: true,
navigationPosition: 'right',
navigationTooltips: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'Portfolio'],
showActiveTooltip: true,
sectionsColor: ['black', 'black', 'black', 'black', 'blue'],
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'firstSlides'],
afterLoad: function(anchorLink, index) {
if (whichBoxIsOpen == 'third') {
console.log(whichBoxIsOpen);
$.fn.fullpage.moveTo('firstSlides');
}
}
});
完整页面可以找到here,请测试select'Portfolio'这是第三个框,注意视图没有切换到幻灯片。
更新-添加图像
哈亚特,
我设法将你的屏幕保持在一个位置,但看起来你的 TweenMax.to($fullScreenOne)
有点乱。此 Codepen 包含我的更改。我会一直在这里玩的。
this是您期待的那种结果吗?基本上,我认为您需要的只是 afterLoad
回调中的一点 setTimeout
。
JavaScript:
...
afterLoad: function(anchorLink, index) {
if (whichBoxIsOpen == 'third') {
setTimeout(function() {
$.fn.fullpage.moveTo('firstSlides');
}, 1000);
}
}
...
让我知道这是否有效。
我在业余项目中使用 FullscreenJS,但在使用提供的 moveTo 方法时遇到问题。
moveTo 正在启动,锚点显示正确的幻灯片,但视图没有改变,它仍然在第一部分。
$.fn.fullpage.moveTo('firstSlides');
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'firstSlides'],
完整定义。
$('#fullpage').fullpage({
navigation: true,
navigationPosition: 'right',
navigationTooltips: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'Portfolio'],
showActiveTooltip: true,
sectionsColor: ['black', 'black', 'black', 'black', 'blue'],
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'firstSlides'],
afterLoad: function(anchorLink, index) {
if (whichBoxIsOpen == 'third') {
console.log(whichBoxIsOpen);
$.fn.fullpage.moveTo('firstSlides');
}
}
});
完整页面可以找到here,请测试select'Portfolio'这是第三个框,注意视图没有切换到幻灯片。
更新-添加图像
哈亚特,
我设法将你的屏幕保持在一个位置,但看起来你的 TweenMax.to($fullScreenOne)
有点乱。此 Codepen 包含我的更改。我会一直在这里玩的。
this是您期待的那种结果吗?基本上,我认为您需要的只是 afterLoad
回调中的一点 setTimeout
。
JavaScript:
...
afterLoad: function(anchorLink, index) {
if (whichBoxIsOpen == 'third') {
setTimeout(function() {
$.fn.fullpage.moveTo('firstSlides');
}, 1000);
}
}
...
让我知道这是否有效。