var oul=document.getElementsByTagName("ul"); var num=0; gePot("get","getPics.php",true,"cpage=1",function (str) { arrAJson=JSON.parse(str); function fn() { for(var i=num;i< arrAJson.length;i++){ var oli=document.createElement("li"); var ominheight=Math.min(oul[0].offsetHeight,oul[1].offsetHeight,oul[2].offsetHeight,oul[3].offsetHeight,oul[4].offsetHeight); oli.innerHTML= `<img src="${arrAJson[i].image}">`; if(ominheight<window.innerHeight+document.documentElement.scrollTop){ for(var j=0;j<oul.length;j++){ if(oul[j].offsetHeight==ominheight){ oli.style.transition="1s"; oul[j].appendChild(oli); num++; if(num==arrAJson.length){ num=0; } }else { window.οnscrοll=function () { fn() } } } } } } fn() })
瀑布流
最新推荐文章于 2024-06-28 14:13:55 发布