zoukankan      html  css  js  c++  java
  • jQuery scroll(滚动)延迟加载

    延迟加载

    $(window).scroll(function(){
        var scrollHeight = $(document).height(); //文档高度
        var scrollTop = $(this).scrollTop(); //滚动条卷去高度
        var windowHeight = $(this).height(); // 窗口高度
        // console.log(scrollHeight, scrollTop, windowHeight)
        if(scrollHeight - scrollTop - windowHeight < 100 ){
            
            console.log("到底了");
            //ajax渲染页面
        }
    });
    jQuery(function($){
        var topicBoxTopHeight = jQuery('#topicBox').offset().top;
        var topicBoxTopHeight_show = 1
        $(window).scroll(function(event){
            
            if($(this).scrollTop() > topicBoxTopHeight-$(window).height()-200 && topicBoxTopHeight_show==1){
                topicBoxTopHeight_show=0;
                topicBoxFn();
            }
    
        });
    })
    cssfirefly http://cssfirefly.cnblogs.com
  • 相关阅读:
    事务的隔离级别
    事务的隔离
    事务简介
    leetcode647
    leetcode394
    leetcode96
    leetcode814
    leetcode738
    leetcode621
    leetcode763
  • 原文地址:https://www.cnblogs.com/cssfirefly/p/3873271.html
Copyright © 2011-2022 走看看