zoukankan      html  css  js  c++  java
  • 大渝网招聘页面用到的 滚动后固定代码

    <script>
    $(document).ready(function(){
        var _width = ($(window).width() - 1003) / 2;
        var isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest;
        var obj = $('.list').get(0);
        $(window).scroll(function(){
            if((document.documentElement.scrollTop +document.body.scrollTop) >= 1049){
                if(!isIE6){
                    $('.list').css({'position':'fixed','right':+_width+'px','top':0});
                }else{
                    if (document.body.currentStyle.backgroundAttachment != "fixed") {
                        if (document.body.currentStyle.backgroundImage == "none") {
                            document.body.runtimeStyle.backgroundImage = "url(none.gif)"; // dummy
                            document.body.runtimeStyle.backgroundAttachment = "fixed";
                        }
                    }
                    obj.style.position = 'absolute';
                    obj.style.setExpression("top", "eval((document.documentElement.scrollTop || document.body.scrollTop) - 590) + 'px'");
                }
            }else{
                $('.list').css({'position':'absolute','right':'0','top':'465px'});
            }
        });
    });
    </script>
  • 相关阅读:
    MetaMask/metamask-extension-provider
    MetaMask/json-rpc-engine
    MetaMask/json-rpc-middleware-stream
    DamonOehlman/detect-browser
    kumavis/obj-multiplex
    java面试第三天
    java面试第二天
    JavaScript公共函数
    Eclipse快捷键大全
    Jdbc入门
  • 原文地址:https://www.cnblogs.com/henshui/p/3147665.html
Copyright © 2011-2022 走看看