简体   繁体   中英

Prevent from adding active class to section on fullpage.js

When loading first section of fullpage.js page, it adds active class to the section. The problem is that class triggers animation behind the scene, so the user will see finished animation. How to prevent fullpage.js from adding active class to the section?

You can use the fullpage.js event callback functions for this,

    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){}

see this documentation https://github.com/alvarotrigo/fullPage.js/

when leaving the first slide add the callback function to the onLeave: to remove the active class from that element, like

$('.class').fullpage({
onLeave: function(index, nextIndex, direction){
// remove the active class here
}
});

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM