我试图篡改从http://soworldwide.org/网站上看到的图片标题视差效果。现在,当我开始滚动时,我想在大标题中逐渐淡出。但是标题很难消失,只有在平滑的…中消失。当我消失的时候,我怎样才能褪色呢?
$(window).scroll(function(){
if($(window).scrollTop()<20){
$('.headline').stop(true,true).fadeIn("slow");
} else {
$('.headline').stop(true,true).fadeOut("slow");
}
});发布于 2015-08-04 07:57:09
这似乎是一个2年前的问题,但是stop()函数阻止了文本上的淡入/淡出效果。看看我们的这里:
$(window).scroll(function(){
if($(window).scrollTop()<20){
//$('.headline').stop(true,true).fadeIn("slow");
$('.headline').fadeIn("slow");
} else {
//$('.headline').stop(true,true).fadeOut("slow");
$('.headline').fadeOut("slow");
}
});https://stackoverflow.com/questions/12988112
复制相似问题