zoukankan      html  css  js  c++  java
  • 一个简单的loading,纯属自娱自乐

    /// <reference path="/scripts/js/jquery.min.js" />
    var zsw = {
        loading: function (imgUrl, content, width) {
            if (content == "" || content == undefined || content == null) {
                content = "正在加载中";
            }
            if (width == "" || width == undefined || width == null) {
                width = 250;
            }
            var h = '<div id="zswloading" style="background:url(' + imgUrl + ') no-repeat 50% 30%; position:fixed; min-100px; background-color:#fff; min-height:100px; ' + width + 'px; height:' + width + 'px; border:2px solid #eee; top:0px; bottom:0px; left:0; right:0; margin:auto;box-shadow:0 0 40px #767373;-moz-box-shadow:0 0 40px #767373;-webkit-box-shadow:0 0 40px #767373; border-radius:50%;">        <div style=" text-align:center; color:#808080; margin-top:70%;">' + content + '...</div>    </div>';
            $("body").append(h);
        },
        closeloading: function () {
            $("#zswloading").remove();
        }
    }
    

      javascript如上,调用如下

    <a href="javascript:void(0)" onclick="zsw.loading('loading.gif','正在处理',200)">打开</a>
        <a href="javascript:void(0)" onclick="zsw.closeloading()">关闭</a>
    

      依赖jquery

    岁月无情催人老,请珍爱生命,远离代码!!!
  • 相关阅读:
    [CQOI2005]三角形面积并(计算几何+扫描线)
    第一天
    LA3026 周期 (kmp)
    HDU 1715 大菲波数 (java大数)
    根据身高重建队列(vector)
    K 连续位的最小翻转次数
    724. Find Pivot Index
    Two Sum
    c
    Most Powerful(状压DP水题)
  • 原文地址:https://www.cnblogs.com/zhoushangwu/p/6134319.html
Copyright © 2011-2022 走看看