zoukankan      html  css  js  c++  java
  • div页面底部对齐[提取修改]

        <script language="javascript" type="text/javascript">
            function $()
            {
                return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);
            }
            var Sys = {};
            var ua = navigator.userAgent.toLowerCase();
            if (window.ActiveXObject)
                Sys.ie = ua.match(/msie ([\d.]+)/)[1]
            else if (document.getBoxObjectFor)
                Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1]
            else if (window.MessageEvent && !document.getBoxObjectFor)
                Sys.chrome = ua.match(/chrome\/([\d.]+)/)[1]
            else if (window.opera)
                Sys.opera = ua.match(/opera.([\d.]+)/)[1]
            else if (window.openDatabase)
                Sys.safari = ua.match(/version\/([\d.]+)/)[1];
        
            function getClientBounds()
            {
                var clientWidth;
                var clientHeight;
               
                if (Sys.ie)
                {
                    clientWidth = document.body.clientWidth;
                    clientHeight = document.body.clientHeight;
                }
                else if (Sys.safari)
                {
                    clientWidth = window.innerWidth;
                    clientHeight = window.innerHeight;
                }
                else if (Sys.opera )
                {
                    clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                    clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                }
                else
                {
                    clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
                    clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                }
     
                return { width : clientWidth, height : clientHeight };
            }
     
            function resetLiveMessengerPosition()
            {
                var clientBounds = getClientBounds();
                var container = document.getElementById("liveMessengerContainer");
               
                var scrollLeft = (document.documentElement.scrollLeft ?
                        document.documentElement.scrollLeft : document.body.scrollLeft);
                var scrollTop = (document.documentElement.scrollTop ?
                        document.documentElement.scrollTop : document.body.scrollTop);
                       
                var containerLeft = scrollLeft + clientBounds.width - container.clientWidth - 5;
                var containerTop = scrollTop + clientBounds.height - container.clientHeight;
                       
                $("liveMessengerContainer").style.top=containerTop + "px";
                $("liveMessengerContainer").style.left=containerLeft + "px";
            }
           
            window.onscroll=function(){resetLiveMessengerPosition();};
            window.onresize=function(){ resetLiveMessengerPosition();};
            window.onload=function(){ resetLiveMessengerPosition();};
        </script>

  • 相关阅读:
    ① ts基础
    ⑦ 原型和原型链 作用域链
    ④ 小程序使用分包
    功能⑦ 小程序整合高德地图定位
    effective OC2.0 52阅读笔记(三 接口与API设计)
    effective OC2.0 52阅读笔记(二 对象、消息、运行期)
    effective OC2.0 52阅读笔记(一 熟悉Objective-C)
    perl的Getopt::Long和pod::usage ?
    安装你自己的perl modules
    Perl 之 use(), require(), do(), %INC and @INC
  • 原文地址:https://www.cnblogs.com/olartan/p/1387420.html
Copyright © 2011-2022 走看看