Scroll bar to scroll the implementation Load picture or request

Scenario 1: Scroll to monitor document case

Page. 1 = var; 
$ ( '# showContent') Scroll (function () {. 
        var scroH = $ (Document) .scrollTop (); // rolling height 
        var viewH = $ (window) .height (); // visible height 
        var contentH = $ (document) .height (); // height content 
        if (contentH == (scroH + viewH )) {// scroll bar to the bottom it 
          Page Page + =. 1; 
          Alert ( 'Ajax request data section '+ page +' part ') 
        }   
})

  

Scenario 2: div for listening on a rolling case

Page. 1 = var; 
$ ( '# showContent') Scroll (function () {. 
        var contentH = $ ( "# showContent") [0] .scrollHeight; 
        . viewH var = $ ( "# showContent") height (); 
        scroH $ = var ( "# showContent") scrollTop ();. 
         IF (contentH == (scroH viewH +)) {// scroll bar to the bottom it 
             Page Page + =. 1; 
            Alert ( 'request data of' + page + 'part') 
          }   
 })                    

  

Guess you like

Origin www.cnblogs.com/sweeeper/p/11267864.html