티스토리 뷰

자바(Java)

jquery 로딩 이미지 코드

xemaker 2018. 9. 28. 16:00

var loadingTemplate="";

loadingTemplate+="<div id='loader-site' class='dark' style='display:none; z-index:99; position:fixed; top:0; left:0; width:100%; height:100%;'> ";

loadingTemplate+=" <div class='dark' style='position:absolute; top:50%; left:50%; margin:-50% 0 0 -50px; width:100px; height:100px; background:rgba(0,0,0,0.3); border-radius:10px;'> ";

loadingTemplate+=" <img src='<c:url value='loading.gif'/>' style='margin-top:-15%; width:100px;' />";

loadingTemplate+=" </div>

loadingTemplate+="<iframe style='position:absolute; top:0; left:0; width:100%; height:100%; border:0 none; z-index:-1;'></iframe> ";

loadingTemplate+="</div>";


loadingTmpl = $(loadingTemplate).appendTo(document.body).hide();


$(window)

.ajaxStart(function(){

loadingTmpl.show();

})

.ajaxError(function(){

loadingTmpl.hide();

})

.ajaxStop(function(){

loadingTmpl.hide();

})

.ajaxComplete(function(){

loadingTmpl.hide();

});



댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함