jquery实现loading蒙版加载

html:<div id="scbackground" class="background" style="display: none; "></div> 

css:(loading-new.gif是加载的动态图,可以在网上找)

<style type="text/css">
.background { 
    display: block; 
    width: 100%; 
    height: 100%; 
    opacity: 0.4; 
    filter: alpha(opacity=40); 
    background:while; 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 2000; 
} 
.background { 
    background: white url(../img/loading-new.gif) no-repeat center; 
    
} 
</style>

js:

var bg = $("#scbackground");

bg.show(); 

回调函数中:bg.hide();

参考:https://www.cnblogs.com/conswin/p/7251341.html

猜你喜欢

转载自blog.csdn.net/u012491783/article/details/81335655