扫码关注官方订阅号
js 如何操作-webkit-filter:blur(1px);
人生最曼妙的风景,竟是内心的淡定与从容!
获取dom属性中的样式用dom.style.property获取css中的属性方法:
1、ie:dom.currentStyle.property 2、其他浏览器 : document.defaultView.getComputedStyle (dom).property;(貌似这样更好:document.defaultView.getComputedStyle(dom)[property]
兼容性写法:
function getStylePropery(dom,property){ if(window.getComputedStyle){ return document.defaultView.getComputedStyle(dom)[property]; }else if(dom != null && dom.currentStyle[property]){ return dom.currentStyle[property]; }else{ return null; } }
对于复合属性,一般把类似-webkit-filter写成webkitFilter,font-size写成fontSize等等。
(第一次回答,求不喷)
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
获取dom属性中的样式用dom.style.property
获取css中的属性方法:
兼容性写法:
对于复合属性,一般把类似-webkit-filter写成webkitFilter,font-size写成fontSize等等。
(第一次回答,求不喷)