画说惠山

画说惠山Huishan Pictures

关于我们友情链接联系我们 | 项目招商 | 人才招聘
旅游热线:0510-83333833
$(function(){ function myWaterfall(){ $('#grid').stop().animate({'opacity':0},200); var _numOfCol = 3; var _numX = 8; var _winw = $(window).width(); $('#grid').BlocksIt({ numOfCol: _numOfCol, offsetX: _numX, offsetY: 6, blockElement: 'li' }); $('#grid').stop().animate({'opacity':1},500); } $(window).load(function(){ myWaterfall(); }); $(".pic").fancybox(); // 下拉加载更多 var url=$('.next_page').attr('href'),end=0; function getData(){ $.get(url,function(data){ if(typeof(url)=="undefined"){ end=0; $('.spinner').html('').css('width','100%'); } else { $('.ul-list').append($(data).find('.ul-list li')); url=$(data).find('.next_page').attr('href'); end=1; myWaterfall(); } }); console.log(url); } var items = $(".ul-list li"); var numPage = 3; var numAdd = 3; //items.slice(numPage).hide(); $(".spinner").on('inview', function(event, isInview) { console.log(isInview); if(isInview){ if(!items.is(':hidden')) { //alert("已经是最后一页了!"); getData(); }else{ items.slice(numPage, numPage + numAdd).fadeIn(); numPage += numAdd; } } }); });