//서비스(사이트)별 달라지는 자바스크립트 $(function () { const menuBar = $(".menu_bar"); const closeBtn = $(".header .close_btn"); menuBar.on("click", function () { $(".header").show( "slide", { direction: "right", }, 300 ); $(".header_back").fadeIn(300); $(".main_wrap").on("scroll mousewheel", function (event) { event.preventDefault(); event.stopPropagation(); return false; }); }); closeBtn.on("click", function () { $(".header").hide( "slide", { direction: "right", }, 300 ); $(".header_back").fadeOut(300); $(".main_wrap").off("scroll touchmove mousewheel"); }); $(".header_back").on("click", function () { $(".header_back").fadeOut(300); $(".header").hide( "slide", { direction: "right", }, 300 ); $(".main_wrap").off("scroll touchmove mousewheel"); }); // $(".mypage_modal_wrap").on("scroll touchmove mousewheel", function (event) { // event.preventDefault(); // event.stopPropagation(); // return false; // }); $(".mypage_modal .close_btn").on("click", function () { $(".mypage_modal_wrap").css("display", "none"); }); $(".token_btn_wrap a") .eq(0) .mouseenter(function () { $(".img_list li").eq(0).css("opacity", "1"); }) .mouseleave(function () { $(".img_list li").eq(0).css("opacity", "0"); }); $(".token_btn_wrap a") .eq(1) .mouseenter(function () { $(".img_list li").eq(1).css("opacity", "1"); }) .mouseleave(function () { $(".img_list li").eq(1).css("opacity", "0"); }); $(".token_btn_wrap a") .eq(2) .mouseenter(function () { $(".img_list li").eq(2).css("opacity", "1"); }) .mouseleave(function () { $(".img_list li").eq(2).css("opacity", "0"); }); $(".token_btn_wrap a") .eq(3) .mouseenter(function () { $(".img_list li").eq(3).css("opacity", "1"); }) .mouseleave(function () { $(".img_list li").eq(3).css("opacity", "0"); }); }); function profileNftModify() { $(".mypage_modal_wrap.modify").css("display", "flex"); } function ticketLog() { $(".mypage_modal_wrap.travel").css("display", "flex"); } //일반형 상세보기 클릭시 function handleClickSbpViewMore(pid) { loader(true); $.ajax({ type: "GET", url: "/mypage/sbp_view_modal.php", data: { mode: 'sbp_view', pid: pid, }, success: function(data) { if (data) { $('#SbpViewMoreModal').html(data); $(".mypage_modal_wrap.sbp_view_more").css("display", "flex"); loader(false); } } }); } //확정형 상세보기 클릭시 function handleClickSbpViewMoreFixed(pid) { loader(true); $.ajax({ type: "GET", url: "/mypage/sbp_view_fixed_modal.php", data: { mode: 'sbp_view_fixed', pid: pid, }, success: function(data) { if (data) { $('#SbpViewMoreFixedModal').html(data); $(".mypage_modal_wrap.sbp_view_more_fixed").css("display", "flex"); loader(false); } } }); } //KPS 투자자 상세보기 클릭시 function handleClickKpsViewMore(user_id) { loader(true); $.ajax({ type: "GET", url: "/mypage/kps_view_modal.php", data: { mode: 'kps_view', user_id: user_id, }, success: function(data) { if (data) { $('#KpsViewMoreModal').html(data); $(".mypage_modal_wrap.kps_view_more").css("display", "flex"); loader(false); } } }); } function handleClickViewSBPContract(idx, sbpType) { if (sbpType == 1) { location.href = "/mypage/sbp_normal_contract_down.php?idx=" + idx; } else if (sbpType == 2) { location.href = "/mypage/sbp_fixed_contract_down.php?idx=" + idx; } } //로딩바 on/off (박경호, 2023-08-21 11:57) : S function loader(action) { if (document.getElementById("shadow-host") == null) { init(); } const shadowHost = document.getElementById("shadow-host"); if (action == true) { const shadowRoot = shadowHost.attachShadow({ mode: "open" }); // Shadow DOM 내부에 요소 추가 const backdrop = document.createElement("div"); backdrop.classList = "backdrop"; shadowRoot.appendChild(backdrop); const span = document.createElement("span"); span.classList = "loader"; backdrop.appendChild(span); // Shadow DOM 내부에 스타일 추가 const style = document.createElement("style"); style.textContent = ` .backdrop { z-index: 9000; background-color: rgba(0,0,0,0.4); position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; } .loader { width: 48px; height: 48px; border: 5px solid #FFF; border-bottom-color: transparent; border-radius: 50%; display: inline-block; box-sizing: border-box; animation: rotation 1s linear infinite; } @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } `; shadowRoot.appendChild(style); } else if (action == false) { shadowHost.shadowRoot.host.remove(); // Shadow DOM 호스트 요소 제거 init(); } function init() { const newShadowHost = document.createElement("div"); newShadowHost.id = "shadow-host"; const body = document.body; body.appendChild(newShadowHost); } } //로딩바 on/off (박경호, 2023-08-21 11:57) : E //다국어작업 (박경호, 2023-08-22 16:37) : S function Lan_chk(n) { if (isEmpty(n)) { return; } setCookie("cookie_lang", n, 30, "/", ".spowars.co.kr"); location.reload(); // if(n=="en") { // AlertError('준비중입니다'); // $("select[name=lang]").val('kr'); // return; // } } //다국어작업 (박경호, 2023-08-22 16:37) : E