摘要: 一、getComputedStyle在项目中,我们经常会用到获取dom对象的css值,然后对其重新设置,一般我们都会用element.style来获取或设置,但是这种只能取到dom结构上带的style,如果是外链的那么就获取不到;那怎么办呢,我们可以用window的getCompuedStyle来获取;调用方法如下:window.getComputedStyle(ele,null).attribute;例如获取width属性值,就window.getComputedStyle(ele,null).width;提醒几点:1、getComputedStyle只能用window调用,而且是只读的,e 阅读全文
posted @ 2013-11-29 14:02 黑暗骑士之“闪” 阅读(176) 评论(0) 推荐(0) 编辑