jQuery實(shí)現(xiàn)按鈕點(diǎn)擊遮罩加載及處理完后恢復(fù)的效果
本文實(shí)例講述了jQuery實(shí)現(xiàn)按鈕點(diǎn)擊遮罩加載及處理完后恢復(fù)的效果。分享給大家供大家參考,具體如下:
運(yùn)行效果圖如下:
具體代碼如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EasyUiLoad.aspx.cs" Inherits="EasyUiLoad" %> <!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 runat="server"> <title>EasyUI加載效果</title> <style type="text/css"> body{font-size:12px} .datagrid-mask{position:absolute;left:0;top:0;width:100%;height:100%;opacity:.5;filter:alpha(opacity=30);background-color:#e0ecff;display:none} .datagrid-mask-msg{position:absolute;top:50%;margin-top:-20px;padding:10px 15px 10px 15px;width:auto;height:16px;border-width:2px;border-color:#68a5ff;border-style:solid;display:none} .img1{vertical-align:middle;} </style> <script src="JS/jquery-1.9.1.js" type="text/javascript"></script> <script type="text/javascript"> //load function EasyUILoad() { $("<div class=\"datagrid-mask\"></div>").css({ display: "block", width: "100%", height: "auto !important" }).appendTo("body"); $("<div class=\"datagrid-mask-msg\"></div>").html("<img src='images/loading.gif' class='img1' /> 正在運(yùn)行,請稍候。。。").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(window).height() - 45) / 2 }); } //display Load function dispalyEasyUILoad() { $(".datagrid-mask").remove(); $(".datagrid-mask-msg").remove(); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" Text="加載效果" OnClientClick="javascript:EasyUILoad();" onclick="Button1_Click" /> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class EasyUiLoad : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(5000); //處理邏輯... //完成處理后恢復(fù) ClientScript.RegisterStartupScript(this.GetType(), "closeLoad", "dispalyEasyUILoad();", true); } }
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jquery中Ajax用法總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》、《jquery選擇器用法總結(jié)》及《jQuery常用插件及用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)彈出帶遮罩層的居中浮動(dòng)窗口效果
- jQuery實(shí)現(xiàn)右鍵菜單、遮罩等效果代碼
- jQuery彈出遮罩層效果完整示例
- jQuery操作dom實(shí)現(xiàn)彈出頁面遮罩層(web端和移動(dòng)端阻止遮罩層的滑動(dòng))
- Jquery實(shí)現(xiàn)遮罩層的簡單實(shí)例(就是彈出DIV周圍都灰色不能操作)
- 使用jQuery制作遮罩層彈出效果的極簡實(shí)例分享
- jquery實(shí)現(xiàn)簡單的遮罩層
- Jquery實(shí)現(xiàn)自定義彈窗示例
- jquery制作彈窗提示窗口代碼分享
- jQuery實(shí)現(xiàn)簡單彈窗遮罩效果
相關(guān)文章
Jquery CheckBox全選方法代碼附j(luò)s checkbox全選反選代碼
喜歡上了Jquery的簡便、明了···與用JavaScript寫的比起來真的有點(diǎn)差距!2010-06-06Jquery實(shí)現(xiàn)仿京東商城省市聯(lián)動(dòng)菜單
這篇文章主要介紹了Jquery實(shí)現(xiàn)仿京東商城省市聯(lián)動(dòng)菜單的簡單實(shí)例演示,可以選擇對(duì)應(yīng)省、市、縣,希望大家可以喜歡。2015-11-11