zoukankan      html  css  js  c++  java
  • 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);

  • 相关阅读:
    索引
    互联网技术中的算法摘要
    Struts2(六)
    Struts2(五)
    Struts2(四)
    Struts2(三)
    Struts2(二)
    Struts2(一)
    WebService(三)
    WebService(二)
  • 原文地址:https://www.cnblogs.com/RedRoshan/p/3571555.html
Copyright © 2011-2022 走看看