From 7e63d354c80ac29d2d71f8fab35367d69bfbbb76 Mon Sep 17 00:00:00 2001 From: "Lim\\jun" Date: Tue, 9 May 2023 16:36:18 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=88=EC=82=B0=20loading=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/js/common.js | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index 759b677d..000ecf11 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -356,4 +356,38 @@ function ajaxErrorAction(e){ location.href="/"; } } +} + +function LoadingWithMask() { + //화면의 높이와 너비를 구합니다. + let maskHeight = $(document).height(); + let maskWidth = window.document.body.clientWidth; + + //화면에 출력할 마스크를 설정해줍니다. + let mask = ""; + + //화면에 레이어 추가 + $("body") + .append(mask) + + //마스크의 높이와 너비를 화면 것으로 만들어 전체 화면을 채웁니다. + $("#mask").css({ + 'width' : maskWidth, + 'height': maskHeight, + 'opacity' : '0.7' + }); + $("#loadingImg").css({ + 'position' : 'absolute', + 'z-index' : '100', + 'top' : '50%', //parseInt(maskHeight)/2-20 + 'left' : '50%', //parseInt(maskWidth)/2-20, + }); + + //마스크 표시 + $("#mask").show(); +} + +function WithoutMask() { + $("#mask, #loadingImg").hide(); + $("#mask, #loadingImg").remove(); } \ No newline at end of file