您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

根据百分比设置宽度

2024/2/27 19:16:18发布15次查看
var grid_width; 
var grid_init=false;
function caculate_grid_width_func(){
var tabpanel = $('#documentlist').closest('.tabs-panels'); 
if(tabpanel.length>0){ 
grid_width = tabpanel.width(); 
}else{ 
grid_width=$('#documentlist').width(); 
}
}
/**设置百分比*/ 
function count_width_func(columnwidth){ 
var result = 128; 
var diff = 0; 
columnwidth=null==columnwidth||''==columnwidth||'100%'==columnwidth?'128':columnwidth;
if ( $.browser.msie ){ 
if('9.0'==$.browser.version ) 
diff=3; 
else if('8.0'==$.browser.version ) 
diff=3; 
else 
diff=6; 

else if($.browser.chrome) 
diff=5; 
else 
diff=2;
if(columnwidth.indexof('%')>0){ 
columnwidth=columnwidth.replace('%','')*1; 
result=grid_width*columnwidth/100; 

else if(columnwidth.indexof('px')>0){ 
columnwidth=columnwidth.replace('px',''); 
result=columnwidth; 

else 
result=columnwidth; 
return math.ceil(result)-diff; 
}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product