我正在使用 wow js 和 animated.css,它太棒了我真的很喜欢当我尝试在用户滚动 500 像素时运行效果时遇到了一个小问题。
我可以看到 jquery 正在插入类以运行效果,但我看不到效果,如果我的 jquery 很丑,也请随时修复。
我在我的页面上插入了 wow 和 animated.css 类手册并且效果很好,当我尝试与 jquery 一起使用时会发生此错误,有代码。
之前的html:
<footer>
</footer>
html运行后效果:
<footer class="wow shake" style="visibility: visible; animation-name: shake;">
js:
var fixed = false;
$(document).scroll(function() {
if( $(this).scrollTop() >= 500 ) {
if( !fixed ) {
fixed = true;
// $('footer').css({position:'fixed',top:20});
$('footer').addClass('wow shake').css({visibility: 'visible', 'animation-name': 'shake'});
// .one('animationend webkitAnimationEnd mozanimationend MSanimationend oAnimationEnd');
}
} else {
if( fixed ) {
fixed = false;
$('footer').removeClass('wow shake');
}
}
});