码迷,mamicode.com
首页 > Web开发 > 详细

js读取CSS样式表样式

时间:2015-02-04 12:42:45      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

js中obj.style.height不能直接取css样式和嵌入的样式(style标签包起来的),

需要用

getComputedStyle 

但IE又不支持,只能这样做:

function getstyle(obj) {
return window.getComputedStyle ? window.getComputedStyle(obj, null).height : obj.currentStyle.height;
}

js读取CSS样式表样式

标签:

原文地址:http://www.cnblogs.com/duan11-11/p/4272004.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!