如何解决wow.js与fullpage的兼容性

项目需要做到全屏显示的同时还需要做到实时执行动画。但是发现在使用fullpage之后,wow.js(不知道这个是啥的点击这里)不起作用。

找了诸多资料,解决方法如下:

 

$('#fullpage').fullpage({
    verticalCentered:true,
    css3:true,
    paddingTop:70,
    anchors: ['page1', 'page2', 'page3],
    scrollBar: true,
    afterRender: function(){
        wow = new WOW({
            animateClass: 'animated',
         });
        wow.init();
     }
});

主要起作用的代码是要把scrollBar设置为true,并且把动画事件放在afterRender里面。 

 

 

转自:https://www.cnblogs.com/sese/p/5694385.html?utm_source=itdadao&utm_medium=referral

posted @ 2020-05-10 14:08  KSnow  阅读(639)  评论(0编辑  收藏  举报