PHP完全自学手册(珍藏版) 中文pdf扫描版下载
- $(document).ready(function(){
- $(window).scroll(function(){
- scrollMore();
- });
- function scrollMore(){
- if($(window).scrollTop() == ($(document).height() - $(window).height())){
- var offset = $('[id^="myData_"]').length; // here we find out total records on page.
- var records = $(".allData").text();
- $(window).unbind("scroll");
- if(records != offset){
- $("#loaderImg").html('<img src="images/ajax-loader.gif" />');
- $("#loaderImg").show();
- loadMoreData(offset);
- }
- }
- }
- function loadMoreData(offset){
- $.ajax({
- type: 'get',
- async:false,
- url: 'getMoreData.php',
- data: 'offset='+offset,
- success: function(data){
- $("#loaderImg").empty();
- $("#loaderImg").hide();
- $(".loadData :last").after(data);
- },
- error: function(data){
- alert("ajax error occured?+data);
- }
- }).done(function(){
- $(window).bind("scroll",function(){
- scrollMore();
- });
- });
- }
- });
转载请注明:谷谷点程序 » php各种滚动加载分页打包下载