我有一个横幅,在滚动和它下面的一些内容收缩,我如何才能让内容在横幅上停留几秒钟后再移动?我试着使用jQuery插件stickem,但它似乎不起作用。
JS:
$(document).scroll(function(){
if ($(this).scrollTop()>175){
// animate fixed div to small size:
$('.wrapper').stop().animate({ height: 57 , 'padding-top': 50},100);
$('.text').stop().animate({ 'bottom': 50},100);
} else {
// animate fixed div to original size
$('.wrapper').stop().animate({ height: 300, 'padding-top': 0},100);
$('.text').stop().animate({ 'bottom': 150},100);
}
}); http://jsfiddle.net/bnsUB/259/
发布于 2015-05-23 05:17:02
我通常不建议使用插件,但是对于这样的事情,航点是一个很好的插件。
http://imakewebthings.com/waypoints/
https://stackoverflow.com/questions/30405961
复制相似问题