瀑布流布局



//滚动
window.onscroll = function() {
		var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
		if(scrollTop >= 120) {
			oBack.style.display = 'block'
		} else {
			oBack.style.display = 'none';
		}
		oBack.addEventListener('touchstart', function() {
			document.body.scrollTop = 0;
		})

		var pageHeight = $(document).height();
		// 可视区域高度           
		var viewHeight = $(window).height();

		var aList = oNav_list.getElementsByTagName('li');
		if((scrollTop + viewHeight) > (pageHeight - 20)) {
			setTimeout(function(){
				if(aList.length<=30)
			{
				switch(page)
				{
				case 0:
						url="data/News"+1+".json"
						loadInfo(url);
						break;
				case 1:
						url="dataiewpoint"+1+".json"
						loadInfo(url);
						break;
				case 2:
						url="data/shopGuid"+1+".json"
						loadInfo(url);
						break;
				case 3:
						url="data/tushuo"+1+".json"
						loadInfo(url);
						break;
				case 4:
						url="data/activity"+1+".json"
						loadInfo(url);
						break;
				case 5:
						url="datasiness"+1+".json"
						loadInfo(url);
						break;
				}
			}
			},500);
			
		}
	}

posted @ 2017-04-07 15:09  sakura-sakura  阅读(126)  评论(0编辑  收藏  举报