JS 获取浏览器窗口大小方面的

function getDocument() {
        var de = document.documentElement;
        var body = {
            clientWidth: self.innerWidth || (de && de.clientWidth) || document.body.clientWidth, //只得到页面可见宽
            clientHeight: self.innerHeight || (de && de.clientHeight) || document.body.clientHeight, //只得到页面可见高
            scrollTop: window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 //页面被卷上去的高度
        };
        return body;
    }

针对IE的滤镜样式

浮动最上层

position:fixed; _position:absolute; left:0; top:0;

_top:expression(window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);

浮动居中

position:fixed; _position:absolute; margin:-130px 0 0 -280px; left:50%; top:50%;

_top:expression((window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop)+(document.documentElement.clientHeight||document.body.clientHeight)/2);

原文地址:https://www.cnblogs.com/RedRoshan/p/3571555.html