fullpagejs和AOS – 没有合作

我正在使用fullpagejs和AOS在页面底部弹出一些div(或者至少是我想要实现的)。

不幸的是,它没有用。

是的,我已经阅读了fullpage的FAQ部分,是的, scrollbar设置为true ,autoscroll设置为false

我的设置如下:

 
{someOtherContent}
test
$('#test').fullpage({ lazyLoading: false, lockAnchors: true, scrollingSpeed: 300, fitToSection: false, easing: 'easeInOutCubic', easingcss3: 'ease', loopHorizontal: false, offsetSections: false, resetSliders: false, scrollOverflow: true, scrollOverflowReset: true, touchSensitivity: 0, bigSectionsDestination: top, keyboardScrolling: false, animateAnchor: false, recordHistory: true, controlArrows: false, verticalCentered: true, responsiveWidth: 0, responsiveHeight: 0, sectionSelector: '.section', slideSelector: '.slide', scrollBar:true //events afterLoad: function (anchor, index( { initArrowEventListener() }

afterLoad事件函数只是初始化我的菜单链接(基于幻灯片索引),唯一相关的部分是我在点击一个特定链接时初始化AOS (因为我希望库只能在特定页面上工作,而不是在任何地方。

所以,我加载页面,单击导航我想要的滑块页面,调用该函数(控制台日志certificate它,以及AOS类应用于相关div),我可以看到滚动条,但没有, div不会从底部突然出现。

知道我在这里做错了什么吗? 谢谢

这支笔说明了同样的问题。 单击“关于”(初始化AOS的function也称为标题的function),滚动到底部,您将看到大量的空白区域。 如果检查控制台,则会在元素上初始化aos(应用其类)但元素永远不会向上滑动)

仅使用AOS的css部分并在fullpage.js回调上连接aos-animate。

手动添加AOS正文数据

  

添加aos-init类

 $('[data-aos]').each(function(){ $(this).addClass("aos-init"); }); 

使用fullpage.js回调切换aos-animate类

 $('#fullpage').fullpage({ slidesNavigation: true, controlArrows: false, onLeave: function(){ $('.section [data-aos]').each(function(){ $(this).removeClass("aos-animate") }); }, onSlideLeave: function(){ $('.slide [data-aos]').each(function(){ $(this).removeClass("aos-animate") }); }, afterSlideLoad: function(){ $('.slide.active [data-aos]').each(function(){ $(this).addClass("aos-animate") }); }, afterLoad: function(){ $('.section.active [data-aos]').each(function(){ $(this).addClass("aos-animate") }); }}); 

示例HTML

 

fade me up!

zoom me in!

flip me down!

Interesting Posts