/* 공통 초기화 기능 */ let mySlidePopSwiper; $(document).ready(function() { processPopup(); //2024.07.23 팝업관련 추가 //Swiper 슬라이드 팝업 mySlidePopSwiper = new Swiper('#slide-popup > .swiper', { direction: 'horizontal', effect: 'fade', slidesPerView: 1, // 보여질 슬라이더수 }); //좌우버튼 $('#slide-popup .btn-prev').on('click', function (e) { e.preventDefault(); // 이벤트 객체의 preventDefault 메소드를 실행하면 기본 동작이 취소된다 mySlidePopSwiper.slidePrev() // return false ; // ie9 이하 버전에서는 event.returnValue를 false로 해야 한다. }) $('#slide-popup .btn-next').on('click', function (e) { e.preventDefault(); //이벤트 객체의 preventDefault 메소드를 실행하면 기본 동작이 취소된다 mySlidePopSwiper.slideNext() //return false ; // ie9 이하 버전에서는 event.returnValue를 false로 해야 한다. }); }); var POPUP_URL = "/component/popup/ND_selectOpenPopup.do"; var LAYER_URL = "/component/popup/ND_selectOpenLayer.do"; // 문서 로드가 끝나면 실행되어 팝업을 종류에 맞게 생성한다. var processPopup = function() { var layerCnt = 0; if(opPopupConfigList && opPopupConfigList.length > 0) { for(var i = 0 ; i < opPopupConfigList.length ; i++) { var popupConf = opPopupConfigList[i]; var cookieName = popupConf.cookiePrefix + popupConf.sn; var value = Cookies.get(cookieName); if(!value || popupConf.popupCycle == "3040") { switch(popupConf.popupTy) { case "1010": opShowPopup(popupConf); break; case "1020": opShowLayer(popupConf); layerCnt++; break; case "1030": opShowExpand(popupConf); break; default: break; } } } //2024.07.22 추가 if(layerCnt > 0) { $("#slide-popup").addClass("visible"); if(document.getElementById('slide-popup')){ if ('scrollRestoration' in history) { history.scrollRestoration = 'manual'; //새로고침해도 자동 스크롤 기억하여 팝업영역 밖으로 이동하는 내용 수정 } //document.getElementById('slide-popup').scrollIntoView({ behavior: 'smooth' }); //팝업영역으로 화면 이동(새로고침하면 이코드때문에 위로 갔다가 스크롤 기억된 위치로 다시감..) } } } }; // 팝업 오픈 var opShowPopup = function(popupConf) { var option = "chrome, centerscreen, dependent=yes, left="+ popupConf.leftLc +", top="+ popupConf.upendLc +","; option += "width="+ popupConf.widthSize +", height="+ popupConf.vrticlSize +", "; option += "dialog=yes, modal=yes, location=0, status=0, menubar=0, toolbar=0, "; // 스크롤 여부 if(popupConf.scrollAt == "Y"){ option += "scrollbars=yes, "; }else{ option += "scrollbars=no, "; } // 리사이징 여부 if(popupConf.resizingAt == "Y"){ option += "resizable=yes"; }else{ option += "resizable=no"; } var href = POPUP_URL + "?sn=" + popupConf.sn; var popupOpenWin = window.open(href, "opShowPopup"+ popupConf.sn, option); if (popupOpenWin != null) { popupOpenWin.focus(); } return false; }; // 레이어 오픈 var opShowLayer = function(popupConf) { //2024.07.22 수정전 코드 //var style = "style=\"z-index:10000;position: absolute; top: "+popupConf.upendLc+"px; left: "+popupConf.leftLc+"px; width: "+popupConf.widthSize+"px; height: "+popupConf.vrticlSize+"px;\""; //var layerWin = "