获取对象样式

// 获取对象计算的样式

        this.getComputerStyle = (function() {

            var body = document.body;

            if (body.currentStyle) {// IE浏览器

                return function(elem) {

                    return elem.currentStyle;

                }

            } else if (document.defaultView.getComputedStyle) {// 标准浏览器

                return function(elem) {

                    return document.defaultView.getComputedStyle(elem, null);

                }

            }

        })();

你可能感兴趣的:(对象)