X龙@China .Net 'blog

需要的不仅仅是工作,而是通过努力得来的美好将来。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

js获取页面引用的css样式表中的属性值方法

Posted on 2011-03-08 12:48  X龙  阅读(3012)  评论(0编辑  收藏  举报
function getStyle(node, property){

            
if (node.style[property]) {
                
return node.style[property];

            } 
            
else if (node.currentStyle) {
                
return node.currentStyle[property];
            } 
            
else if (document.defaultView && document.defaultView.getComputedStyle) {
                
var style = document.defaultView.getComputedStyle(node, null);
                
return style.getPropertyValue(property);
            }

            
return null;

        }
点击这里给我发消息http://wp.qq.com/index.html