$(window).resize(function(){
var $boxs = $('#main>div');
$boxs.each(function(index,value){
$(value).css('position','')
});
waterfall();
});
記得重新調(diào)用之前先清除position。
var $boxs = $('#main>div');
$boxs.each(function(index,value){
$(value).css('position','')
});
waterfall();
});
記得重新調(diào)用之前先清除position。
2017-08-05
@堂堂唐家大少爺, 解決這位大少爺?shù)膯栴}。
$(window).resize(function(){
var cols = Math.floor(document.documentElement.clientWidth/aBoxW);
// oParent.style.cssText = 'width:' + aBoxW*cols + 'px';
$('#main').css("width",aBoxW*cols);
})
在視窗重新變化的時候刷新一遍操作就解決了
$(window).resize(function(){
var cols = Math.floor(document.documentElement.clientWidth/aBoxW);
// oParent.style.cssText = 'width:' + aBoxW*cols + 'px';
$('#main').css("width",aBoxW*cols);
})
在視窗重新變化的時候刷新一遍操作就解決了
2017-08-05
已采納回答 / 慕粉205724528
' '里面是字符串,你的代碼就是這個意思{width:(oBoxsW?*?cols)px +margin:?0?auto}你覺得這是一個正常的CSS樣式嗎?{width:(oBoxsW?*?cols)px;margin:?0?auto}應(yīng)該是這樣的
已采納回答 / 你好_盼再見
你這個頁面渲染出現(xiàn)了問題,應(yīng)該是在定位時出現(xiàn)了問題,可能你視頻并沒有看完,定位有一步十分關(guān)鍵,定位的位置是在高度最小的下面進(jìn)行渲染,這時候如果你的高度寫死,在循環(huán)時沒有進(jìn)行高度的修改就會出現(xiàn)此問題,你只需要在循環(huán)最后加上一個hArr[minHIndex] += $boxs.eq(index).outerHeigt();即可(ps:我在這寫的是通過JQuery實(shí)現(xiàn)的方法,如果你要用其他的方法請看視頻。)
2017-07-25
已采納回答 / 陽光下的霧
第24最后好像沒加 ?'px'
最新回答 / 幕布斯1509990
arr 是一個數(shù)組,目的應(yīng)該是為了獲取數(shù)組里的arr的高度,有兩種寫法1.arr[i]=Box[i].offsetHeight(若設(shè)外邊距需注意)2.arr.push(Box[i].offsetHeight)不懂再回復(fù)
最新回答 / 葡萄3
。。。。知道哪里錯了
function getByClass(clsName, parent){
if(parent){
var listid=document.getElementById(parent);
var on1=listid.getElementsByClassName(clsName);
return on1;
}else{
var onnodes=document.getElementsByClassName(clsName);
return onnodes;}
if(parent){
var listid=document.getElementById(parent);
var on1=listid.getElementsByClassName(clsName);
return on1;
}else{
var onnodes=document.getElementsByClassName(clsName);
return onnodes;}
2017-07-20