zoukankan      html  css  js  c++  java
  • smartFloat

    $.fn.smartFloat = function() {
        var position = function(element) {
            var top = element.position().top, pos = element.css("position");
            $(window).scroll(function() {
                var scrolls = $(this).scrollTop();
                if (scrolls > top) {
                    if (window.XMLHttpRequest) {
                        element.css({
                            position: "fixed",
                            top: 0
                        });    
                    } else {
                        element.css({
                            top: scrolls
                        });    
                    }
                }else {
                    element.css({
                        position: "absolute",
                        top: top
                    });    
                }
            });
        };
        return $(this).each(function() {
            position($(this));                         
        });
    };
    //使用:
    //$("#nav_left_layout").smartFloat();
  • 相关阅读:
    [VC++]轻松搞VC之定时器(Timer)
    [VC++]VC中如何获得当前系统时间
    [VC++]如何利用this获得窗口句柄
    SMART原则
    SQL配置
    术语百科
    关于SQL锁问题
    第六代OA办公理念(摘录)
    心动机型
    SQL2008R2的索引重建
  • 原文地址:https://www.cnblogs.com/apollokk/p/6713877.html
Copyright © 2011-2022 走看看