zoukankan      html  css  js  c++  java
  • 很多人想要的Jquery 加载Loading效果,可以加到自己的项目中,结合Ajax使用

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>loading效果</title>
        <script language="javascript" type="text/javascript" src="/Scripts/jquery-1.4.4.min.js"></script>
        <script type="text/javascript">
            function showLoad(tipInfo) {
                var eTip = document.createElement('div');
                eTip.setAttribute('id', 'tipDiv');
                eTip.style.position = 'absolute';
                eTip.style.display = 'none';
                eTip.style.border = 'solid 0px #D1D1D1';
                eTip.style.backgroundColor = '#4B981D';
                eTip.style.padding = '5px 15px';
                eTip.style.top = '10px';
                eTip.style.right = '10px';
                eTip.style.width = '120px';
    
                eTip.innerHTML = '<img src=\'/Images/loader.gif\' style=\'float:left;\' />&nbsp;&nbsp;<span style=\'color:#ffffff; font-size:12px\'>' + tipInfo + '</span>';
                try {
                    document.body.appendChild(eTip);
                } catch (e) { }
                $("#tipDiv").css("float", "right");
                $("#tipDiv").css("z-index", "99");
                $('#tipDiv').fadeIn();
            }
    
            function closeLoad() {
                $('#tipDiv').fadeOut();
            }
        </script>
    </head>
    <body>
    <input type="button" value="查看效果" onclick="showLoad('正在运行中...');" />
    <input type="button" value="关闭效果" onclick="closeLoad();" />
    </body>
    </html>
    
    <asp:Button ID="Button1" runat="server" Text="查询施工价格" OnClientClick="showLoad('正在查询中...');" OnClick="Button1_Click" />
    
    protected void Button1_Click(object sender, EventArgs e)
    {
    	//处理完成后
    	ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "close", "closeLoad();", true); 
    }


  • 相关阅读:
    PHP获取一周的日期
    关系型数据库和非关系型数据库的区别和特点
    关系型数据库和非关系型数据库的特性以及各自的优缺点
    什么是数据库?什么是关系数据库?什么是非关系型数据库?
    PHP中把对象转数组的几个方法
    验证银行卡号
    xss过滤方法
    PHP 随机字符
    计算两个日期相差年月日
    判断一个时间段是否包含周末
  • 原文地址:https://www.cnblogs.com/smartsmile/p/6234427.html
Copyright © 2011-2022 走看看