Javascript 阻止将活动类添加到fullpage.js上的节
加载fullpage.js页面的第一部分时,它会将Javascript 阻止将活动类添加到fullpage.js上的节,javascript,fullpage.js,Javascript,Fullpage.js,加载fullpage.js页面的第一部分时,它会将active类添加到该部分。问题是类在场景后面触发动画,所以用户将看到完成的动画。如何防止fullpage.js将active类添加到节中?您可以使用fullpage.js事件回调函数 onLeave: function(index, nextIndex, direction){}, afterLoad: function(anchorLink, index){}, afterRender: function(){},
active
类添加到该部分。问题是类在场景后面触发动画,所以用户将看到完成的动画。如何防止fullpage.js将active
类添加到节中?您可以使用fullpage.js事件回调函数
onLeave: function(index, nextIndex, direction){},
afterLoad: function(anchorLink, index){},
afterRender: function(){},
afterResize: function(){},
afterResponsive: function(isResponsive){},
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex){},
onSlideLeave: function(anchorLink, index, slideIndex, direction, nextSlideIndex){}
请参阅此文档
离开第一张幻灯片时,将回调函数添加到onLeave:
以从该元素中删除活动类,如
$('.class').fullpage({
onLeave: function(index, nextIndex, direction){
// remove the active class here
}
});
您可以为此使用fullpage.js事件回调函数
onLeave: function(index, nextIndex, direction){},
afterLoad: function(anchorLink, index){},
afterRender: function(){},
afterResize: function(){},
afterResponsive: function(isResponsive){},
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex){},
onSlideLeave: function(anchorLink, index, slideIndex, direction, nextSlideIndex){}
请参阅此文档
离开第一张幻灯片时,将回调函数添加到onLeave:
以从该元素中删除活动类,如
$('.class').fullpage({
onLeave: function(index, nextIndex, direction){
// remove the active class here
}
});
好的,如果我进入第一张幻灯片呢?是的,您可以使用
afterLoad
回调。请查看此网站,在那里您可以看到滑动时每个回调的工作情况@yuriy NOk,如果我进入第一张幻灯片呢?是的,你可以使用afterLoad
回调。请查看此网站,在那里您可以看到滑动时每个回调的工作情况@尤里恩