且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在jquery中向下滚动页面时显示div

更新时间:2022-06-22 01:10:57

您可以尝试类似的情况:

You may try this similar case:

http://jsfiddle.net/j7r27/

$(window).scroll(function() {
$("div").each( function() {
    if( $(window).scrollTop() > $(this).offset().top - 100 ) {
        $(this).css('opacity',1);
    } else {
        $(this).css('opacity',0);
    }
}); 
});