图片
css部分
#tipDiv {
display: none;
position: absolute;
left: 39%;
top: 230px;
z-index: 9999;
background: #d9d9d9;
padding: 10px;
border-radius: 5px;
}
#tipInfo {
margin-top: 10px;
}
html部分
<div id="tipDiv">
<center><img style="width:25px;" src="img/5-121204193R5-50.gif"></center>
<div id="tipInfo"></div>
</div>
js部分
//显示
function showTip(info) {
$('#tipInfo').html(info);
$('#tipDiv').show();
}
//加载结束关闭
function closeTip() {
$('#tipDiv').hide();
}
$.ajax({
type: "get",
url: "",
dataType: 'json',
async: true,
data: {},
beforeSend: function() {
showTip('内容正在加载...')
},
complete: function() {
closeTip()
},
success: function(res) {}
});