ajax发送请求是图标转圈圈实现

css部分

.load-img{

//控制图标大小
width:40px;
height:40px;
margin:100px;
border-radius:50%;
-webkit-animation:circle 1s infinite linear;/*匀速 循环*/
margin: 0 auto;
}
@-webkit-keyframes circle{
0%{ transform:rotate(0deg); }
100%{ transform:rotate(-360deg); }

}
.load-img{
margin: 0 auto;
}
.load-img img{
width: 100%
}

 

 

 

ajax部分:

$.ajax({
data : {
userid: pageid,
id:17,
page:index,
fir_id:2,
sec_id:17,
limit:prepage,},
url : 'center',
type : 'post',
beforeSend: function () {
// 图标转转转
displayPart.html('<div class="load-img"><img src="/assets/img/load.png" ></div>');

},
success : function( json ){
json = JSON.parse( json );
var json = json.data
displayPart.html(insertCommon(json));
}
});

 

posted on 2017-10-26 19:38  芸芸众生!  阅读(975)  评论(0编辑  收藏  举报