如何实现浏览器兼容版的window.getComputedStyle
来源:互联网 发布:剑三脸型数据怎么修改 编辑:程序博客网 时间:2024/06/06 09:27
window.getComputedStyle能够获取元素的实际样式,但是低版本的ie8及以下不支持,如何在低版本的ie上兼容类似的功能
- //获取当前样式
- function getStyle(element, att){
- //特性侦测
- if(window.getComputedStyle){
- //优先使用W3C规范
- return window.getComputedStyle(element)[att];
- }else{
- //针对IE9以下兼容
- return element.currentStyle[att];
- }
- }
0 0
- 如何实现浏览器兼容版的window.getComputedStyle
- 实现浏览器兼容版的window.getComputedStyle
- 火狐浏览器 window.getComputedStyle()返回值的问题
- 如何实现浏览器兼容版的inline-block显示
- 如何实现浏览器兼容版的element.dataset
- 如何实现浏览器兼容版的element.children
- window.getComputedStyle()方法的使用
- getComputedStyle兼容
- window.getComputedStyle
- 实现浏览器兼容版的element.dataset
- 实现浏览器兼容版的element.children
- window.getComputed浏览器兼容
- window.onscroll兼容浏览器
- currentStyle和getComputedStyle的兼容写法
- 兼容各版本浏览器的关闭事件window.close
- js的window.onscroll事件兼容各大浏览器
- js的window.onscroll事件兼容各大浏览器!
- js的window.onscroll事件兼容各大浏览器!
- 导出指定格式的excel
- Java_scaner用法
- Oracle11g Dataguard配置
- ubuntu安装Sublime Text 3
- bootstrap源码阅读(一)——modal原理
- 如何实现浏览器兼容版的window.getComputedStyle
- iOS -类方法
- KK's Reconstruction
- Linux Mint (专题五:压缩工具)
- Redis数据结构和对象(一)
- Linux开发环境搭建(二)
- 在window7系统下安装双系统 之--Redhat
- pom.xml详解
- LeetCode 300: Longest Increasing Subsequence