function denb_popup_init() { // 오늘하루보지않기 선택/삭제 var inputBoxShow = true var _height = 548; console.log("test"); // 슬라이드 이미지 소스 배열 var slideImages = ["https:\/\/denb.co.kr\/site_popup\/img\/\/20240424101231-66285c7fdd744-442.jpg"] // 버튼 소스 배열 var buttonInfoArray = [] // 쿠키 설정 함수 function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function isMobileDevice() { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); } // 쿠키 가져오는 함수 function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function deleteCookie(cname) { document.cookie = cname + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; } // 팝업을 생성하고 body에 추가합니다. var $popup_div = $('
', { id: 'popup_div', class: 'popup_div', style: 'position: absolute; z-index: 999999; width: 100%; top: 50%; display: flex; justify-content: center;', appendTo: 'body' }); var $popup = $('
', { id: 'popup', class: 'popup', style: 'position: fixed; background-color: rgba(26, 26, 58, 1); z-index: 999999; top:50%; transform: translate(0, -50%);; border-radius: 5px;', // style: 'position: fixed; background-color: rgba(0, 0, 0, 0.5); z-index: 999999; top:50%; transform: translate(0, -50%); border-radius: 5px;', appendTo: $popup_div }); // 슬라이더를 생성하고 팝업에 추가합니다. var $slider = $('
', { class: 'slider', style: 'width: 548px; height: 548px; margin-bottom: 0', appendTo: $popup }); var $btnBox = $('
', { class: 'btnBox', style: 'width: 548px; display:flex; juste ', appendTo: $popup }); var $inputBox = $('
', { class: 'inputBox', style: 'padding-top: 10px;padding-bottom:10px; width: 98%; display: flex; justify-content: flex-end;', appendTo: $popup }); var $closeBox = $('
', { class: 'closeBox', style: 'display: flex; justify-content: flex-end; padding: 10px; border-radius: 5px;', prependTo: $popup }); var $closeBtn = $('
', { class: 'closeBtn', style: 'display: flex; justify-content: center; align-items: center; width: 30px; height: 30px; background-color: #1A1A3A;color: #FFF; border-radius: 5px; cursor: pointer; font-weight: 900;', text: '✕', prependTo: $closeBox, click: function() { $popup.hide(); $slider.slick('unslick'); } }); // 슬라이드 이미지를 배열에서 가져와 슬라이더에 추가합니다. slideImages.forEach(function(imageSrc) { $('
Slide
').appendTo($slider); }); var _btn = ""; // 버튼을 생성하고 팝업에 추가합니다. buttonInfoArray.forEach(function(buttonInfo) { var _onclick = ""; if (buttonInfo.openInNewWindow == 'open') { _onclick = "window.open('"+buttonInfo.url+"', '_blank')"; } else { _onclick = "window.location.href = "+buttonInfo.url; } var temp = buttonInfo.text.split("
"); if(temp.length==2) { _btn += ""; } else { _btn += ""; } /* $('', nextArrow: '', }); var popupClosed = getCookie("popupClosed"); if (popupClosed) { document.getElementById("popup").style.display = "none"; } $('.slick-dots').css('bottom', '20px'); $('.slick-next').css({ 'right': '20px', 'z-index': '10' }); $('.slick-prev').css({ 'left': '20px', 'z-index': '10' }); } $(document).ready(function(){ denb_popup_init(); }); function denb_popup_btn_1(uuid) { alert('버튼1클릭'); document.location.href="http://denb.co.kr/a.php?dentist_idx="; }