Having trouble adding aos.js using classes

拜拜、爱过 提交于 2020-02-06 03:46:14

问题


I have a Gutenberg website and I want to add animations that the use can control, I am using aos (animate on scroll) and I figured, if I create a class then loop over it and that adds the relevant data-aos values e.g.

$('.aos-fade-up').each(function(i) {
    $(this).attr('data-aos', 'fade-up');
});

It works as intended, adds the relevant attribute, and the content is hidden, but nothing happens on scroll.

What is the problem here? The attribute is on, it hides the content but nothing happens on scroll.

Pen here: https://codepen.io/StuartAttain/pen/MWWzVpe

来源:https://stackoverflow.com/questions/58885987/having-trouble-adding-aos-js-using-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!