移动端加载loading动画

在这里插入图片描述
图片
在这里插入图片描述
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) {}
	});	

猜你喜欢

转载自blog.csdn.net/weixin_42442123/article/details/84875407