首页 > Web开发 > 详细

js读取CSS样式表样式

时间:2015-02-04 12:42:05      阅读:378      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!