加某个属性,支持该属性在后台配置下前端的显示运行:
1
2
3
4
5
6
7
8
9
10
|
if
($(n).attr(
"field"
)&&$(n).attr(
"field"
)==
"1"
){
var
wrapperWidth=$(n).find(
"div[id*=fsUploadProgress]"
).width();
$(n).find(
".progress"
).each(
function
(){
$(
this
).css(
"width"
,wrapperWidth+
"px"
);
$(
this
).find(
".Container"
).css(
"width"
,wrapperWidth*0.9+
"px"
);
var
_width = $(
this
).find(
".Container"
).width()-30;
$(
this
).find(
".progressName"
).css({
"overflow"
:
"visible"
,
"width"
:_width+
"px"
});
$(
this
).find(
".progressName"
).children(
"div:has('.fl')"
).css(
"width"
,
"80%"
);
});
}
|
总结:
-
在项目中,一般都用精确的值,百分比会有浮动的差异。
-
合并css样式可以用数组:.css({"":"","":""});
-
查找某个div下的class可以用:children("div:has('.f1')");
本文转自 爱笑嘚蛋蛋 51CTO博客,原文链接:http://blog.51cto.com/dd118/1677993,如需转载请自行联系原作者