很多人想要的Jquery 加载Loading效果,可以加到自己的项目中,结合Ajax使用

转载自:http://blog.csdn.net/smartsmile2012/article/details/7971763

[html]  view plain copy print ?
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2.   
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head>  
  5.     <title>loading效果</title>  
  6.     <script language="javascript" type="text/javascript" src="/Scripts/jquery-1.4.4.min.js"></script>  
  7.     <script type="text/javascript">  
  8.         function showLoad(tipInfo) {  
  9.             var eTip = document.createElement('div');  
  10.             eTip.setAttribute('id', 'tipDiv');  
  11.             eTip.style.position = 'absolute';  
  12.             eTip.style.display = 'none';  
  13.             eTip.style.border = 'solid 0px #D1D1D1';  
  14.             eTip.style.backgroundColor = '#4B981D';  
  15.             eTip.style.padding = '5px 15px';  
  16.             eTip.style.top = '10px';  
  17.             eTip.style.right = '10px';  
  18.             eTip.style.width = '120px';  
  19.   
  20.             eTip.innerHTML = '<img src=\'/Images/loader.gif\' style=\'float:left;\' />&nbsp;&nbsp;<span style=\'color:#ffffff; font-size:12px\'>' + tipInfo + '</span>';  
  21.             try {  
  22.                 document.body.appendChild(eTip);  
  23.             } catch (e) { }  
  24.             $("#tipDiv").css("float", "right");  
  25.             $("#tipDiv").css("z-index", "99");  
  26.             $('#tipDiv').fadeIn();  
  27.         }  
  28.   
  29.         function closeLoad() {  
  30.             $('#tipDiv').fadeOut();  
  31.         }  
  32.     </script>  
  33. </head>  
  34. <body>  
  35. <input type="button" value="查看效果" onclick="showLoad('正在运行中...');" />  
  36. <input type="button" value="关闭效果" onclick="closeLoad();" />  
  37. </body>  
  38. </html>  
[csharp]  view plain copy print ?
  1. <asp:Button ID="Button1" runat="server" Text="查询施工价格" OnClientClick="showLoad('正在查询中...');" OnClick="Button1_Click" />  
  2.   
  3. protected void Button1_Click(object sender, EventArgs e)  
  4. {  
  5.     //处理完成后  
  6.     ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "close""closeLoad();"true);   
  7. }  

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值