for(var i = 0; i < aBox.length; i++) {? ? ? ? if(i < cnum) {? ? ? ? ? ? aBox[i].style.top = 0 + 'px';? ? ? ? ? ? aBox[i].style.left = boxwidth * i + 'px';? ? ? ? ? ? aBoxHeight.push(aBox[i].offsetHeight);? ? ? ? }? ? ? ? else {? ? ? ? ? ? var minHeight = Math.min.apply(null,aBoxHeight);? ? ? ? ? ? var minIndex = getIndex(aBoxHeight,minHeight);? ? ? ? ? ? aBox[i].style.position = 'absolute';? ? ? ? ? ? aBox[i].style.top = minHeight+'px';? ? ? ? ? ? aBox[i].style.left = aBox[minIndex].offsetLeft+'px';? ? ? ? ? ? aBoxHeight[minIndex] +=aBox[i].offsetHeight;?? ? ? ? }? ? }??aBox[i].style.top = 0 + 'px';前面為什么不加上一句?aBox[i].style.position = 'absolute';第一行以外的圖片定位都加了的
javascript瀑布流圖片定位問題
趙日天l
2016-07-27 14:11:24