最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery animate實(shí)現(xiàn)鼠標(biāo)放上去顯示離開隱藏效果

 更新時(shí)間:2013年07月21日 17:53:06   作者:  
本文為大家介紹下使用jquery animate實(shí)現(xiàn)鼠標(biāo)放上去顯示,離開就隱藏的效果,感興趣的朋友可以參考下哈,希望對(duì)大家有所幫助
1、CSS樣式:
復(fù)制代碼 代碼如下:

@CHARSET "UTF-8";
* html .showbox,* html .overlay {
position: absolute;
top: expression(eval(document.documentElement.scrollTop) );
}
#AjaxLoading {
border: 1px solid #8CBEDA;
color: #37a;
font-size: 12px;
font-weight: bold;
}
#AjaxLoading div.loadingWord {
width: 180px;
height: 50px;
line-height: 50px;
border: 2px solid #D6E7F2;
background: #fff;
}
#AjaxLoading img {
margin: 10px 15px;
float: left;
display: inline;
}
.overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 998;
width: 100%;
height: 100%;
_padding: 0 20px 0 0;
background: #f6f4f5;
display: none;
}
.showbox {
position: fixed;
top: 0;
left: 50%;
z-index: 9999;
opacity: 0;
filter: alpha(opacity = 0);
margin-left: -80px;
}

2、JS:
復(fù)制代碼 代碼如下:

/**
* 加載動(dòng)畫窗口
*
* @author dendy
* @since 2013-7-19 10:13:05
*/
function getLoadingHtml(msg) {
if(!msg) msg = "加載";
var html = "<div id='loadingDiv'>"
+ "<div style='height: 1325px; display: none; opacity: 0;' class='overlay'></div>"
+ "<div style='opacity: 0; margin-top: 250px;' id='AjaxLoading' class='showbox'>"
+ "<div class='loadingWord'>"
+ "<img src='" + Util.getContentPath() +"/images/ajax-loader.gif'>" + msg + "中,請(qǐng)稍候..."
+ "</div>"
+ "</div>"
+ "<div style='height: 1200px;'></div>"
+ "</div>";
return html;
}
function ajaxLoadingInit(msg) {
var loadingDiv = getLoadingHtml(msg);
var h = $(document).height();
$(".overlay").css({"height": h});
var div = $("body").find("#loadingDiv");
div.remove();
$("body").append($(loadingDiv));
}
/**
* 開始顯示loading,在ajax執(zhí)行之前調(diào)用
* @param msg 操作消息,"加載", "保存", "刪除"
*/
function startLoading(msg) {
ajaxLoadingInit(msg);
$(".overlay").css({'display':'block','opacity':'0.8'});
$(".showbox").stop(true).animate({'margin-top':'300px','opacity':'1'},200);
}
/**
* 加載完成后隱藏,在ajax執(zhí)行完成后(complete)調(diào)用
*/
function endLoading() {
$(".showbox").stop(true).animate({'margin-top':'250px','opacity':'0'},400);
$(".overlay").css({'display':'none','opacity':'0'});
}

3、調(diào)用例子:
復(fù)制代碼 代碼如下:

startLoading();
$.ajax({
type : "POST",
url : this.url,
dataType : "json",
data : this.args,
success : function (data) {

},
complete : function () {
if (self.showLoading == true) endLoading();
},
error : this.error
});

相關(guān)文章

最新評(píng)論

重庆市| 定结县| 长葛市| 漳浦县| 宣化县| 于都县| 巴林左旗| 彭阳县| 兰考县| 诸暨市| 通河县| 基隆市| 长垣县| 即墨市| 白朗县| 登封市| 新余市| 四子王旗| 贵定县| 泽州县| 广宗县| 从江县| 宣武区| 温泉县| 怀柔区| 两当县| 萝北县| 南充市| 汽车| 哈密市| 胶州市| 翁源县| 拉孜县| 杨浦区| 金坛市| 花垣县| 新宁县| 石景山区| 平武县| 太仆寺旗| 徐汇区|