html:
<div class="loading" style="position:fixed; width: 100%; height: 100%; left: 0;top: 0;z-index:9999999;">
<div class="loading_bj">
<img src="images/loading.gif" style="position:fixed; z-index:9999999999; left:50%; top:50%; width: 2rem; height: 2rem; margin-left: -1rem; margin-top: -1rem;">
<p style="position:fixed; z-index:9999999999; left:50%; top:60%; width: 8rem; height: 2rem; margin-left: -4rem; margin-top: -1rem;color: #fff; font-size: 0.6rem;">数据正在加载中,请稍等......</p>
</div>
</div>:
<div class="buy"></div>
js:
1:jq数据库
2:
$(function(){
//定义
var time = 10;
var timer = setInterval(function(){
time--;
if( time = = 0){
clearInterval(timer);
var buy = $(".buy").html('¥‘ + 250);
if(buy == null || buy == 0){
$(".loading").show();
}else{
$(".loading").hide();
}
}else{
if(buy == null || buy == 0){
$(".loading").show();
}else{
$(".loading").hide();
}
}
}
}
网友评论