插件(未完善)

$(function () {
    $(".Loading").css({ "margin": "0px auto", "top": "0px", "min-width": "200px", "width": "auto" });
    $(".Loading").parent().css({ "text-align": "center" });
    var scroll_top = WhichBro();
    if (scroll_top < 100) {

        $(".Loading").parent().css({ "position": "fixed", "top": (100 - document.documentElement.scrollTop) + "px", "left": "0px", "z-index": "99999", "width": $(window).width() + "px", "height": "32px", "line-height": "32px", "background-color": "transparent", "display": "none" });
    } else {

        $(".Loading").parent().css({ "position": "fixed", "top": "0px", "left": "0px", "z-index": "99999", "width": $(window).width() + "px", "height": "32px", "line-height": "32px", "background-color": "transparent", "display": "none" });
    }
    $(window).scroll(function () {
        scroll_top = WhichBro();
        if (scroll_top < 100) {
            $(".Loading").parent().css({ "position": "fixed", "top": (100 - document.documentElement.scrollTop) + "px", "background-color": "transparent" });
        } else {
            $(".Loading").parent().css({ "position": "fixed", "top": "0px", "background-color": $(".Loading").css("background-color") });
        }
    })
    $(".Loading").change(function () {
        scroll_top = WhichBro();
        if (scroll_top < 100) {
            $(".Loading").parent().css({ "display": "block", "background-color": "transparent" });
            $(".Loading").css({ "display": "inline-block" });
        } else {
            $(".Loading").parent().css({ "display": "block", "background-color": $(".Loading").css("background-color") });
            $(".Loading").css({ "display": "inline-block" });
        }
        setTimeout('NotVisible()', 10000);
    })


    $(window).resize(function () {
        scroll_top = WhichBro();
        if (scroll_top < 100) {

            $(".Loading").parent().css({ "position": "fixed", "top": (100 - document.documentElement.scrollTop) + "px", "left": "0px", "z-index": "99999", "width": $(window).width() + "px", "height": "32px", "line-height": "32px", "background-color": "transparent", "display": "none" });
        } else {
            $(".Loading").css({ "left": ($(window).width() - $(".Loading").width()) / 2 + "px", "top": "0px" });
            $(".Loading").parent().css({ "position": "fixed", "top": "0px", "left": "0px", "z-index": "99999", "width": $(window).width() + "px", "height": "32px", "line-height": "32px", "background-color": "transparent", "display": "none" });
        }
    })

    $(".Loading a").click(function () {
        $(".Loading").parent().css("display", "none");
    })
})
function NotVisible() {
    $(".Loading").parent().css("display", "none");
}

function RedirectTo(url) {
    setTimeout("window.location.href='" + url + "'", 10000);
}

function WhichBro() {
    var scroll_top;
    if (document.documentElement && document.documentElement.scrollTop) {
        scroll_top = document.documentElement.scrollTop;
    }
    else if (document.body) {
        scroll_top = document.body.scrollTop; /*某些情况下Chrome不认document.documentElement.scrollTop则对于Chrome的处理。*/
    }
    return scroll_top;
}

html

<div>
                <div class="Loading" style="display: none;">
                    <span id="operateTip">放置提示信息</span>  <a href="javascript:void(0)">X</a>
                </div>
            </div>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值