zoukankan      html  css  js  c++  java
  • 转:jquery 智能浮动定位smartFloat

    层的智能浮动效果

    $.fn.smartFloat = function () {
    var position = function (element) {
    console.log(element);
    var top = element.position().top, pos = element.css("position");
    $(window).scroll(function () {
    var scrolls = $(this).scrollTop();
    if ((scrolls - 30) > top) {
    if (window.XMLHttpRequest) {
    element.css({
    position: "fixed",
    top: 0,
    "100%",
    "background-color": "#FFF",
    "z-index":1
    });
    } else {
    element.css({
    top: scrolls
    });
    }
    } else {
    element.css({
    position: pos,
    top: top
    });
    }
    });
    };
    return $(this).each(function () {
    position($(this));
    });
    };

    $(".curr-date").parent().smartFloat();

    http://www.mamicode.com/info-detail-2149199.html

    https://www.zhangxinxu.com/wordpress/2010/11/js%E9%A1%B5%E9%9D%A2%E6%BB%9A%E5%8A%A8%E6%97%B6%E5%B1%82%E6%99%BA%E8%83%BD%E6%B5%AE%E5%8A%A8%E5%AE%9A%E4%BD%8D%E5%AE%9E%E7%8E%B0jquerymootools/

  • 相关阅读:
    android 加入关屏
    网址导航收集
    OpenStack 中文社区
    Truncate 删除数据
    c# 实体类生成工具
    .net 关系
    html中,播放 flash
    Axis2.0+WebService的使用
    xfire java web服务器引擎
    修复 google paly
  • 原文地址:https://www.cnblogs.com/Ly426/p/10277536.html
Copyright © 2011-2022 走看看