好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

JS获取非行间样式及兼容问题_html/css_WEB-ITnose

获取非行间样式:

             获取非行间样式              #div1{height: 200px;width: 200px;background-color: red;}                  function getStyle(obj,name){            if(obj.currentStyle){                return obj.currentStyle[name]; //IE浏览器            }            else if(getComputedStyle){      //Firefox,chrome浏览器                return getComputedStyle(obj,null)[name];            }        }        window.onload = function(){            var oDiv = document.getElementById('div1');            alert(getStyle(oDiv,'height'));        }       

查看更多关于JS获取非行间样式及兼容问题_html/css_WEB-ITnose的详细内容...

  阅读:28次