ローリング移動終了ページデータの端部に自動的にロードされます

$(ウィンドウ).bind( "スクロール"、機能(){
    IF(getScrollHeight()== getDocumentTop()+ getWindowHeight()){
        //ときに終了したときに、スクロールバー、トリガコンテンツで
        // ajax_function()            
        警告(「下にスライド」);
    }
});

//ドキュメントの高さ
機能getDocumentTop(){
    VAR scrollTopスプライト= 0、= 0 bodyScrollTop、documentScrollTop = 0;
    IF(document.body){
        bodyScrollTop = document.body.scrollTop。
    }
    IF(はdocument.firstChild){
        documentScrollTop = document.documentElement.scrollTop。
    }
    scrollTopスプライト=(bodyScrollTop  -  documentScrollTop> 0)?bodyScrollTop:documentScrollTop。
    console.log( "ドキュメント性の高いscrollTopスプライト:" + scrollTopスプライト)。
    scrollTopスプライトを返します。
}

//可視ウィンドウの高さ
機能getWindowHeight(){
    VAR windowHeight = 0;
    IF(document.compatMode == "CSS1Compat"){
        windowHeight = document.documentElement.clientHeight。
    }他{
        windowHeight = document.body.clientHeight。
    }
    console.log( "可視ウィンドウwindowHeight:" + windowHeight)。
    windowHeightを返します。
}

//スクロールバーの高さをスクロールします
機能getScrollHeight(){
    VAR scrollHeight = 0、bodyScrollHeight = 0、documentScrollHeight = 0;
    IF(document.body){
        bodyScrollHeight = document.body.scrollHeight。
    }
    IF(はdocument.firstChild){
        documentScrollHeight = document.documentElement.scrollHeight。
    }
    scrollHeight =(bodyScrollHeight  -  documentScrollHeight> 0)?bodyScrollHeight:documentScrollHeight。
    console.log( "ロール身長scrollHeight:" + scrollHeight)。
    scrollHeightを返します。
}

おすすめ

転載: www.cnblogs.com/qiaochaoyu/p/11647677.html