您的位置:首页 > Web前端 > JQuery

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

2016-12-29 00:00 806 查看
<!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;\' />  <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);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐