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

    岁月无情催人老,请珍爱生命,远离代码!!!
  • 相关阅读:
    Windows下git使用代理服务器的设置方法
    SQL backup&restore
    css3 随记
    HTML5 上传图片预览
    jQuery.event.move
    css3 html5 手机设备 列表的弹回和加速移动
    16进制与utf-8
    android 使用现成做get请求
    android 往sd卡中写入文件
    android 遍历控件
  • 原文地址:https://www.cnblogs.com/zhoushangwu/p/6134319.html
Copyright © 2011-2022 走看看