getStyle获取元素所绑定的css属性_html/css
来源:懂视网
责编:小采
时间:2020-11-27 16:35:05
getStyle获取元素所绑定的css属性_html/css
getStyle获取元素所绑定的css属性_html/css_WEB-ITnose:function getStyle(el,cssProp){ if(el.currentStyle){ // ie return el.currentStyle[sccProp]; } else if(window.getComputedStyle){ return window.getComputedStyle(el)[sccProp]; } // return el.style[cssProp];}
导读getStyle获取元素所绑定的css属性_html/css_WEB-ITnose:function getStyle(el,cssProp){ if(el.currentStyle){ // ie return el.currentStyle[sccProp]; } else if(window.getComputedStyle){ return window.getComputedStyle(el)[sccProp]; } // return el.style[cssProp];}

function getStyle(el,cssProp){ if(el.currentStyle){ // ie return el.currentStyle[sccProp]; } else if(window.getComputedStyle){ return window.getComputedStyle(el)[sccProp]; } // return el.style[cssProp];}
getStyle获取元素所绑定的css属性_html/css
getStyle获取元素所绑定的css属性_html/css_WEB-ITnose:function getStyle(el,cssProp){ if(el.currentStyle){ // ie return el.currentStyle[sccProp]; } else if(window.getComputedStyle){ return window.getComputedStyle(el)[sccProp]; } // return el.style[cssProp];}