javascript获取css样式文件中定义的样式的方法
2009-11-26 10:03
639 查看
1. //Firefox浏览器支持 2. if (document.defaultView && document.defaultView.getComputedStyle) { 3. var css = document.defaultView.getComputedStyle(element, null); 4. value = css ? css[style] : null; 5. } else if (element.currentStyle) { 6. IE支持. 7. value = element.currentStyle[style]; 8. }
相关文章推荐
- javascript获取css样式文件中定义的样式的方法
- 说说 JavaScript 在 DOM 2、3 级标准中定义的样式规则(属性和方法)
- JavaScript-给iframe里的内容定义样式 获取元素
- javascript的getComputedStyle方法获取节点的计算后的CSS样式
- JavaScript中获取样式值的方法总结
- JavaScript获取HTML元素样式的方法(style、currentStyle、getComputedStyle)
- JavaScript中获取样式的原生方法小结
- javascript获取元素的css样式方法
- 使用getCurrentPosition方法实时获取当前Geolocation信息(附源码文件)--html5、JavaScript
- JavaScript中获取样式的原生方法小结
- JavaScript获取非行间样式的方法
- javascript中获取非行间样式的方法。
- javascript中获取非行间样式的方法
- <input type="file">定义样式并获取上传文件路径及指定文件类型
- javascript中获取非行间样式的方法
- 获取attr属性的值和getDimension方法获取到资源文件中定义的dimension值
- input file 样式以及获取选择文件方法集合
- 原生javascript获取元素样式属性值的方法
- <input type="file">定义样式并获取上传文件路径及指定文件类型
- JavaScript获取css行间样式,内连样式和外链样式的简单方法