首页 > 网站 > WEB开发 > 正文

浏览器滚动条滚动到固定位置效果

2024-04-27 15:03:31
字体:
来源:转载
供稿:网友
// 窗口滚动到一定位置,出现返回顶部图标$(window).bind("scroll", function() {    var top = document.documentElement.scrollTop + document.body.scrollTop;    if (top >= 500) {        $('.xnto_top').show();    } else {        $('.xnto_top').hide();    }});// 文章随鼠标滚动即时加载(不使用mousewheel) $(window).bind("scroll", function() {       var top = document.documentElement.scrollTop + document.body.scrollTop;       var textheight = $(document).height();       if (textheight - top - $(window).height() <= 100) {         $('#tip_load_msg').html("<img src='public/images/mk/article/load1.gif?version=1.0.1' width='100px' height='100px' />");

          

 // 下面使用要处理数据的函数

load_more_data();

       }

});

function load_more_data () {...}

====================================================================================================================================

// 滚动到底部$(document).scrollTop($(document).height());


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表