基于jquery的loading 加載提示效果實現(xiàn)代碼
更新時間:2011年09月01日 21:03:06 作者:
有時候為了更好的用戶體驗,使用jquery的朋友可以參考下代碼。
loading 加載提示 ······ 透明遮罩 居中
body{
margin: 0;
font-size: 12px;
line-height: 100%;
font-family: Arial, sans-serif;
}
.background {
display: block;
width: 100%;
height: 100%;
opacity: 0.4;
filter: alpha(opacity=40);
background:while;
position: absolute;
top: 0;
left: 0;
z-index: 2000;
}
.progressBar {
border: solid 2px #86A5AD;
background: white url(progressBar_m.gif) no-repeat 10px 10px;
}
.progressBar {
display: block;
width: 148px;
height: 28px;
position: fixed;
top: 50%;
left: 50%;
margin-left: -74px;
margin-top: -14px;
padding: 10px 10px 10px 50px;
text-align: left;
line-height: 27px;
font-weight: bold;
position: absolute;
z-index: 2001;
}
<div id="background" class="background" style="display: none; "></div>
<div id="progressBar" class="progressBar" style="display: none; ">數(shù)據(jù)加載中,請稍等...</div>
var ajaxbg = $("#background,#progressBar");
ajaxbg.hide();
$(document).ajaxStart(function () {
ajaxbg.show();
}).ajaxStop(function () {
ajaxbg.hide();
});
作者:曾祥展
復(fù)制代碼 代碼如下:
body{
margin: 0;
font-size: 12px;
line-height: 100%;
font-family: Arial, sans-serif;
}
.background {
display: block;
width: 100%;
height: 100%;
opacity: 0.4;
filter: alpha(opacity=40);
background:while;
position: absolute;
top: 0;
left: 0;
z-index: 2000;
}
.progressBar {
border: solid 2px #86A5AD;
background: white url(progressBar_m.gif) no-repeat 10px 10px;
}
.progressBar {
display: block;
width: 148px;
height: 28px;
position: fixed;
top: 50%;
left: 50%;
margin-left: -74px;
margin-top: -14px;
padding: 10px 10px 10px 50px;
text-align: left;
line-height: 27px;
font-weight: bold;
position: absolute;
z-index: 2001;
}
<div id="background" class="background" style="display: none; "></div>
<div id="progressBar" class="progressBar" style="display: none; ">數(shù)據(jù)加載中,請稍等...</div>
var ajaxbg = $("#background,#progressBar");
ajaxbg.hide();
$(document).ajaxStart(function () {
ajaxbg.show();
}).ajaxStop(function () {
ajaxbg.hide();
});
作者:曾祥展
相關(guān)文章
jquery簡單實現(xiàn)網(wǎng)頁層的展開與收縮效果
這篇文章主要介紹了jquery簡單實現(xiàn)網(wǎng)頁層的展開與收縮效果的方法,涉及jquery中toggle結(jié)合animate方法操作頁面元素屬性的相關(guān)技巧,非常簡單實用,需要的朋友可以參考下2015-08-08
jquery.messager.js插件導(dǎo)致頁面抖動的解決方法
這盤文章介紹了jquery.messager.js插件導(dǎo)致頁面抖動的解決方法,有需要的朋友可以參考一下2013-07-07
jQuery綁定點擊事件與改變事件的方式總結(jié)及多個元素綁定多個事件
我們一說到j(luò)Query中對于元素的修改,就是元素的內(nèi)容、屬性、樣式的修改,下面這篇文章主要給大家介紹了關(guān)于jQuery綁定點擊事件與改變事件的方式總結(jié)及多個元素綁定多個事件的相關(guān)資料,需要的朋友可以參考下2022-12-12
Jquery左右滑動插件之實現(xiàn)超級炫酷動畫效果附源碼下載
這是一款基于jquery.pogo-slider插件實現(xiàn)的多個滑塊切換特效。本篇文章給大家介紹Jquery左右滑動插件之實現(xiàn)超級炫酷動畫效果,對jquery左右滑動插件相關(guān)知識感興趣的朋友參考下2015-12-12
jQuery模板技術(shù)和數(shù)據(jù)綁定實現(xiàn)代碼
如果你用過ASP.NET的數(shù)據(jù)綁定控件,也用過ASP或者JSP里那種通過輸出HTML元素在頁面上顯示數(shù)據(jù)的方法,你就知道ASP.NET數(shù)據(jù)綁定控件有多么方便。如果能夠?qū)⑼瑯拥墓δ茉跒g覽器端用HTML和JavaScript實現(xiàn),那該是多少美妙的事情。2010-05-05
jQuery 類twitter的文本字數(shù)限制帶提示效果插件
基于jquery的仿twitter的文本字數(shù)限制帶提示效果插件,這里提示比較好,不是簡單的限制,給用戶更好的體驗。2010-04-04

