0
我发现这个代码:DEMO元素淡出不起作用正确
当你卷动元素,将出现的元素。但是,效果只是一个不透明的变化。
我试着在元素出现时添加关键帧动画,但当第一个元素出现时,所有其他元素同时出现。
$(document).ready(function() {
/* Every time the window is scrolled ... */
$(window).scroll(function(){
/* Check the location of each desired element */
$('.hideme').each(function(i){
var bottom_of_object = $(this).position().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* If the object is completely visible in the window, fade it it */
if(bottom_of_window > bottom_of_object){
$(this).css({'opacity':'1'});
$('.e1').addClass('animated fadeInUp')
$('.e2').addClass('animated fadeInLeft')
}
});
});
});
完美!非常感谢! – user3245085
非常有用的技术 – user3130064
@ user3245085很高兴提供帮助。不要忘记下次将代码添加到问题中。从codepen或jsFiddle添加演示是一个不错的主意,但是如果没有它们,您的问题仍应该回答。 – apaul