• 很多人想要的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); 
    }


  • 相关阅读:
    C++中使用stringstream进行类型转换操作
    代理模式
    观察者模式 VS 责任链模式
    10.模板方法模式
    2.里氏替换原则
    单一职责原则
    规格模式
    策略模式的扩展——策略枚举
    策略模式 VS 桥梁模式
    原型模式【下】
  • 原文地址:https://www.cnblogs.com/smartsmile/p/6234427.html
Copyright © 2020-2023  润新知