摘要: 使用js操作css属性的写法是有一定的规律的:1、对于没有中划线的css属性一般直接使用style.属性名即可。如:obj.style.margin,obj.style.width,obj.style.left,obj.style.position等。2、对于含有中划线的css属性,将每个中划线去掉并将每个中划线后的第一个字符换成大写即可。如:obj.style.marginTop,obj.style.borderLeftWidth,obj.style.zIndex,obj.style.fontFamily等。这个规律我想大多数的前端开发者也都熟知。但在css中有一个特殊的属性其js使用方法比 阅读全文
posted @ 2013-08-19 15:51 冰~ice 阅读(501) 评论(2) 推荐(1) 编辑