1 2 3/** 4 * ì¸ë¤ì¼ ì´ë¯¸ì§ ìë°ì¼ê²½ì° ê¸°ë³¸ê° ì¤ì 5 */ 6$(window).load(function () { 7 $("img.thumb,img.ThumbImage,img.BigImage").each(function ($i, $item) { 8 var $img = new Image(); 9 $img.onerror = function () { 10 $item.src = "//img.echosting.cafe24.com/thumb/img_product_big.gif"; 11 }; 12 $img.src = this.src; 13 }); 14}); 15 16/** 17 * tooltip 18 */ 19$(".eTooltip").each(function (i) { 20 $(this).find(".btnClose").attr("tabIndex", "-1"); 21}); 22//tooltip input focus 23$(".eTooltip") 24 .find("input") 25 .focus(function () { 26 var targetName = returnTagetName(this); 27 targetName.siblings(".ec-base-tooltip").show(); 28 }); 29$(".eTooltip") 30 .find("input") 31 .focusout(function () { 32 var targetName = returnTagetName(this); 33 targetName.siblings(".ec-base-tooltip").hide(); 34 }); 35function returnTagetName(_this) { 36 var ePlacename = $(_this).parent().attr("class"); 37 var targetName; 38 if (ePlacename == "ePlaceholder") { 39 //ePlaceholder ëì 40 targetName = $(_this).parents(); 41 } else { 42 targetName = $(_this); 43 } 44 return targetName; 45} 46 47/** 48 * eTab 49 */ 50$("body").delegate(".eTab a", "click", function (e) { 51 // í´ë¦í li ì selected í´ëì¤ ì¶ê°, 기존 liì ìë selected í´ëì¤ë ìì . 52 var _li = $(this) 53 .parent("li") 54 .addClass("selected") 55 .siblings() 56 .removeClass("selected"), 57 _target = $(this).attr("href"), 58 _siblings = $(_target).attr("class"), 59 _arr = _siblings.split(" "), 60 _classSiblings = "." + _arr[0]; 61 62 //í´ë¦í íì í´ë¹íë ììë íì±í, 기존 ììë ë¹íì±í í¨. 63 $(_target).show().siblings(_classSiblings).hide(); 64 65 //preventDefault ë a íê·¸ ì²ë¼ í´ë¦ ì´ë²¤í¸ ì¸ì ë³ëì ë¸ë¼ì°ì íëì ë§ê¸° ìí´ ì¬ì©ë¨. 66 e.preventDefault(); 67}); 68 69 70//window popup script 71function winPop(url) { 72 window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no"); 73} 74/** 75 * document.location.href split 76 * return array Param 77 */ 78function getQueryString(sKey) 79{ 80 var sQueryString = document.location.search.substring(1); 81 var aParam = {}; 82 83 if (sQueryString) { 84 var aFields = sQueryString.split("&"); 85 var aField = []; 86 for (var i=0; i<aFields.length; i++) { 87 aField = aFields[i].split('='); 88 aParam[aField[0]] = aField[1]; 89 } 90 } 91 92 aParam.page = aParam.page ? aParam.page : 1; 93 return sKey ? aParam[sKey] : aParam; 94}; 95 96$(document).ready(function(){ 97 // tab 98 $.eTab = function(ul){ 99 $(ul).find('a').click(function(){ 100 var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'), 101 _target = $(this).attr('href'), 102 _siblings = '.' + $(_target).attr('class'); 103 $(_target).show().siblings(_siblings).hide(); 104 return false 105 }); 106 } 107 if ( window.call_eTab ) { 108 call_eTab(); 109 }; 110}); 111(function($){ 112$.fn.extend({ 113 center: function() { 114 this.each(function() { 115 var 116 $this = $(this), 117 $w = $(window); 118 $this.css({ 119 position: "absolute", 120 top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px", 121 left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px" 122 }); 123 }); 124 return this; 125 } 126}); 127$(function() { 128 var $container = function(){/* 129<div id="modalContainer"> 130 <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe> 131</div>'); 132*/}.toString().slice(14,-3); 133 $('body') 134 .append($('<div id="modalBackpanel"></div>')) 135 .append($($container)); 136 function closeModal () { 137 $('#modalContainer').hide(); 138 $('#modalBackpanel').hide(); 139 } 140 $('#modalBackpanel').click(closeModal); 141 zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) { 142 var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup; 143 $('#modalContent').attr('src', $url); 144 $('#modalContent').bind("load",function(){ 145 $(".header .close",this.contentWindow.document.body).bind("click", closeModal); 146 }); 147 $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show(); 148 $('#modalContainer').center().show(); 149 } 150}); 151})(jQuery);
152/////////////////////////////// 153// Common.js - Desktop (Kor) // 154/////////////////////////////// 155 156//search placeholder ì ì© 157document.getElementById("keyword").setAttribute("placeholder", "SEARCH"); 158// 159 160//json category ë¶ë¬ì¤ë ì½ë (ieìë¨) from mobile 161 162var firstLevel = []; 163var navJson; 164 165const asyncNavJson = async () => { 166 const response = await fetch('/exec/front/Product/SubCategory'); 167 const json = await response.json(); 168 // 1. ì ì²´ ì¤ë¸ì í¸ ë°°ì´ì ì 리íê² & 2. ëë¶ë¥ë§ ì¶ì¶ 169 const standardArray = json.map(({ cate_no, parent_cate_no, name, link_product_list }) => ({ 170 children: [], 171 cat_id: cate_no, 172 parent_id: parent_cate_no, 173 link: link_product_list, 174 name: name 175 })).filter(item => item.parent_id === 1); 176 // 3. íì ë¶ë¥ë¤ì ê·¸ ë°ë¡ ìì ë¶ë¥ì ì½ì 177 json.reduce((acc, cur, index) => { 178 if(cur.parent_id == 1) return; 179 const navigationObj = { 180 children: [], 181 cat_id: cur.cate_no, 182 parent_id: cur.parent_cate_no, 183 link: cur.link_product_list, 184 name: cur.name 185 }; 186 const found2nd = acc.find(a => a.cat_id === cur.parent_cate_no); 187 found2nd !== undefined ? found2nd['children'].push(navigationObj) : null; 188 acc.forEach(a => { 189 if (a.children.length < 1) return; 190 const found3rd = a.children.find(a => a.cat_id === cur.parent_cate_no) 191 found3rd !== undefined ? found3rd['children'].push(navigationObj) : null; 192 }); 193 return acc; 194 }, standardArray); // single dimesion => 3d dimension ends 195 196 // console.log(standardArray); 197 198 // 5. html ë§ë¤ê¸° 199 // 5-1 200 const makingDepth3 = (depth3) => { 201 const depth3HTML = 202 `<ul class="sub-nav-third depth-3-list"> 203 ${depth3.children.map(grandchild => ` 204 <li class="depth-3-item"> 205 <a class="depth-3-anchor" href="${grandchild.link}">${grandchild.name}</a> 206 </li> 207 `).join('')} 208 </ul>`; 209 210 return depth3.children.length > 0 ? depth3HTML: ''; 211 } 212 const makingDepth2 = (depth2) => { 213 214 const depth2HTML = 215 216 ` 217 <ul class="sub-nav depth-2-list"> 218 ${depth2.children.map(child => ` 219 <li class="depth-2-item ${depth2.children.length > 0 ? 'has-child' : ''}"> 220 <a class="depth-2-anchor" href="${child.link}">${child.name}</a> 221 ${makingDepth3(child)} 222 </li> 223 `).join('')} 224 </ul> 225 `; 226 227 return depth2.children.length > 0 ? depth2HTML: ''; 228 } 229 230 231 const makingHtml = (arr, target) => { 232 var secondDepth=''; 233 arr.forEach(single => { 234 if(single.cat_id == '73'){ 235 secondDepth = ` 236 <li data-target="?cate_no=${single.cat_id}" class="depth-1-item ${single.children.length > 0 ? 'has-child' : ''} displaynone"> 237 <a class="depth-1-anchor" onclick="${single.children.length > 0 ? 'navSecOn(this,event)' : ''}" href="${single.link}">${single.name}</a> 238 ${makingDepth2(single)} 239 </li>`; 240 }else{ 241 secondDepth = ` 242 <li data-target="?cate_no=${single.cat_id}" class="depth-1-item ${single.children.length > 0 ? 'has-child' : ''}"> 243 <a class="depth-1-anchor" onclick="${single.children.length > 0 ? 'navSecOn(this,event)' : ''}" href="${single.link}">${single.name}</a> 244 ${makingDepth2(single)} 245 </li>`; 246 } 247 248 document.getElementById(target).innerHTML += secondDepth; 249 }); 250 } //ì¢ ë£ 251 252makingHtml(standardArray,'async-nav'); 253 // ë©ì¸ë©ë´ íìí¨/íììí¨ 254} 255asyncNavJson(); 256 257 258function preventA(event) { 259 event.preventDefault(); 260} 261 262function navBgOn(element,event) { 263 event.preventDefault(); 264 265 if (document.querySelector(".inner-nav>ul>li.has-child.child-opened") !== null) { 266 var activeNavbg = document.querySelector(".inner-nav>ul>li.has-child.child-opened"); 267 activeNavbg.classList.remove("child-opened"); 268 element.parentElement.classList.add("child-opened"); 269 document.body.classList.add('header-opened'); 270 }else { 271 element.parentElement.classList.add("child-opened"); 272 document.body.classList.add('header-opened'); 273 } 274 275 // if (document.querySelector(".sub-nav-bg-backdrop.default") !== null) { 276 // var backdrop = document.querySelector(".sub-nav-bg-backdrop.default"); 277 // backdrop.classList.remove("default"); 278 // } 279 280 if (document.querySelector(".search-trigger.search-opened") !== null) { 281 document.querySelector(".search-trigger.search-opened").classList.remove("search-opened"); 282 } 283 284} 285 286function navBgOff() { 287 if (document.querySelector(".inner-nav>ul>li.has-child.child-opened") !== null) { 288 var activeNavbg = document.querySelector(".inner-nav>ul>li.has-child.child-opened"); 289 activeNavbg.classList.remove("child-opened"); 290 } 291 292 var navBanners = document.querySelectorAll(".nav-banners-wrap .nav-banner"); 293 for (var i = 0; i < navBanners.length; i++) { 294 navBanners[i].classList.remove("show"); 295 } 296 297 var backdrop = document.querySelector(".sub-nav-bg-backdrop"); 298 backdrop.classList.add("default"); 299 document.body.classList.remove('header-opened'); 300} 301// 302 303//í¤ë ver.2 304 305//sidebar open 306function asideActive(event) { 307 event.preventDefault(); 308 document.body.classList.toggle("aside-opened"); 309 310 if (document.querySelector("body.search-opened") !== null) { 311 document.querySelector("body.search-opened").classList.remove("search-opened"); 312 } 313 314 // if (document.querySelector(".sub-nav-bg-backdrop.default") !== null) { 315 // var backdrop = document.querySelector(".sub-nav-bg-backdrop.default"); 316 // backdrop.classList.remove("default"); 317 // } 318} 319 320//inner nav 2 321function navBgOnClick(element,event) { 322 event.preventDefault(); 323 324 element.parentElement.classList.toggle("child-opened"); 325 326 // if (document.querySelector(".inner-nav>ul>li.has-child.child-opened") !== null) { 327 // var activeNavbg = document.querySelector(".inner-nav>ul>li.has-child.child-opened"); 328 // activeNavbg.classList.remove("child-opened"); 329 // element.parentElement.classList.add("child-opened"); 330 // document.body.classList.add('header-opened'); 331 // }else { 332 // element.parentElement.classList.add("child-opened"); 333 // document.body.classList.add('header-opened'); 334 // } 335 336} 337 338//search ê²ì 339function searchOpen(element, event) { 340 event.preventDefault(); 341 if (document.querySelector(".inner-nav>ul>li.has-child.child-opened") !== null) { 342 var activeNavbg = document.querySelector(".inner-nav>ul>li.has-child.child-opened"); 343 activeNavbg.classList.remove("child-opened"); 344 if (document.querySelector(".nav-banner.show") !== null) { 345 document.querySelector(".nav-banner.show").classList.remove("show"); 346 } 347 } 348 //element.parentElement.classList.toggle("search-opened"); 349 document.body.classList.toggle("search-opened"); 350} 351function searchClose() { 352 document.body.classList.remove("search-opened"); 353} 354// 355 356//footer 모ë¬ë°ì¤ 357function infoBox(element, event) { 358 event.preventDefault(); 359 360 var infoBox = document.querySelectorAll(".info-box"); 361 362 if (element.parentElement.className.indexOf("ft-modal") < 0) { 363 for (var i = 0; i < infoBox.length; i++) { 364 infoBox[i].parentElement.classList.remove("ft-modal"); 365 } 366 element.parentElement.classList.add("ft-modal"); 367 } else { 368 for (var i = 0; i < infoBox.length; i++) { 369 infoBox[i].parentElement.classList.remove("ft-modal"); 370 } 371 } 372} 373// 374 375// main-prd / plp / search ê³µíµ sold-out í´ëì¤ 376var soldOut = document.querySelectorAll('.ec-base-product .prdList .sold-out-only'); 377for(var i=0; i<soldOut.length; i++){ 378 var outContent = soldOut[i].querySelector('.icon_img'); 379 // console.log(soldOut[i]); 380 if(outContent !== null){ 381 soldOut[i].parentElement.classList.add('no-stock'); 382 }else { 383 } 384} 385 386//ë¹ëì¤ ì¬ë¼ì´ë ë²í¼ 387function vidOn(index) { 388 if (vidSlider[index].played === false) { 389 vidSlider[index].video.play(); 390 vidSlider[index].played = true; 391 document.body.classList.add("vid-play"); 392 } else { 393 vidSlider[index].video.pause(); 394 vidSlider[index].played = false;
395 document.body.classList.remove("vid-play"); 396 } 397} 398// 399 400//íìê°ì , íìì ë³´, 주ìë¡, 주ìë¡ìì í¼ íì 401function reQuired() { 402 if (document.querySelector(".common-required") !== null) { 403 var reqTh = document.querySelectorAll(".common-required .ec-base-table table tbody th img"); 404 405 for (var i = 0; i < reqTh.length; i++) { 406 var reqTxt = document.createElement("span"); 407 reqTxt.className = "require-text"; 408 409 if (reqTh[i].getAttribute("alt") === "íì") { 410 reqTh[i].classList.add("displaynone"); 411 reqTxt.textContent = "(íì)"; 412 }else { 413 reqTxt.textContent = "(ì í)"; 414 } 415 reqTh[i].parentElement.append(reqTxt); 416 } 417 } 418} 419// 420// reQuired(); 421 422/*ë©ì¸ë ë°°ë ì ì²´ ë ë°°ëë¡ ì ì©*/ 423if(document.querySelector('.main-line-banner-slider') !== null) { 424 //ê³µíµ ìë¨ ë ë°°ë 425 let swiperMain2 = new Swiper(".main-line-banner-slider", { 426 direction: "vertical", 427 loop: true, 428 autoplay: { 429 delay: 4000, 430 }, 431 speed: 1500, 432 }); 433} 434 435/*responsive ë°ì¤í¬í ë°ìí í¤ë*/ 436 437function navSecOn(element,event){ 438 event.preventDefault(); 439 element.parentElement.classList.toggle('third'); 440} 441 // 442 /*responsive ë°ì¤í¬í ë°ìí í¤ë ë*/ 443 444//íì´ì§ ë¡ë© 445window.addEventListener("load", function () { 446 document.getElementById("wrap").classList.add("loaded"); 447}); 448 449function _clear() { 450} 451 452 453///////////////////////////////// 454// Main-only.js -Desktop (Kor) // 455///////////////////////////////// 456 457//ë°°ë 2ê° ì´ìì¼ ë ì¬ë¼ì´ë 458 459 460let swiperInsideNavigator = []; //prd navigator ì ì²´ ì¬ë¼ì´ë ìì ìí ì¬ë¼ì´ë (ê°ë³) 461 462let sliderL = document.querySelectorAll(".main-full-slider .main-slide-wrap"); 463 464function mainSlide() { 465 //ë©ì¸ íì¬ì´ì¦ ë°°ë 466 if (sliderL.length > 1) { 467 let swiperMain = new Swiper(".main-full-swiper .main-full-slider", { 468 direction: "horizontal", 469 loop: false, 470 autoplay: { 471 delay: 3000, 472 }, 473 pagination: { 474 el: ".main-full-swiper .swiper-pagination", 475 }, 476 navigation: { 477 nextEl: ".main-full-swiper .swiper-button-next", 478 prevEl: ".main-full-swiper .swiper-button-prev", 479 }, 480 }); 481 } else { 482 document.querySelectorAll('.main-full-swiper .swiper-button').forEach(single => single.classList.add('displaynone')) 483 484 } 485} 486 487/*ë©ì¸ì§ì´ìí í*/ 488var tContent = document.querySelectorAll(".each-content"); 489var tTitle = document.querySelectorAll(".tab-title li"); 490 491function getGiftTitle() { 492 for (var i = 0; i < tContent.length; i++) { 493 var titleNum = tTitle[i].dataset.num; 494 var elCont = tContent[i].dataset.num; 495 496 var giftText = tContent[i].querySelector(".main-plp-title").textContent; 497 498 if (titleNum == elCont) { 499 tTitle[i].querySelector("a").textContent = giftText; 500 } 501 } 502} 503 504getGiftTitle(); 505 506function tabTitle(event, element) { 507 event.preventDefault(); 508 var currentCont = element.parentElement.dataset.num; 509 510 for (var i = 0; i < tContent.length; i++) { 511 tContent[i].classList.remove("current-tab"); 512 tTitle[i].classList.remove("current-title"); 513 514 var elCont = tContent[i].dataset.num; 515 516 if (elCont == currentCont) { 517 tContent[i].classList.add("current-tab"); 518 element.parentElement.classList.add("current-title"); 519 } 520 } 521} 522/*//ë©ì¸ì§ì´ìí í*/ 523 524/* ìí ë¤ë¹ê²ì´í° ë§ë¤ê¸°*/ 525const makingNavigator = () => { 526 const navSwiperTarget = document.querySelector(".main-prd-navigator .swiper-wrapper"); 527 const mainPrdUpdated = navSwiperTarget.querySelectorAll(".nav-info-slide"); 528 navSwiperTarget.innerHTML = ""; 529 530 mainPrdUpdated.forEach((prdSlide, index) => { 531 const mainPrdWrap = document.createElement("div"); 532 mainPrdWrap.classList.add("main-prd-nav-wrap", "swiper-slide"); 533 const indexPlus = index + 1; 534 mainPrdWrap.dataset.crIndex = indexPlus; 535 let imgIndex = indexPlus.toString().length == 1 ? "0" + indexPlus : indexPlus; 536 537 const navigatorTemplate = ` 538 <div class="title mobile-only"> 539 <h2>PRODUCT NAVIGATOR</h2> 540 </div> 541 <div class="prd-nav-img"> 542 <div class="img-container"><img style="height:auto" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABlCAYAAADu36WvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAylpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i
54277u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMS1jMDAxIDc5LjE0NjI4OTk3NzcsIDIwMjMvMDYvMjUtMjM6NTc6MTQgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCAyNS4zIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMwNzhFNUZEQjFDNDExRUU5MUU1REM2NkMyMjYyQ0VDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjMwNzhFNUZFQjFDNDExRUU5MUU1REM2NkMyMjYyQ0VDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzA3OEU1RkJCMUM0MTFFRTkxRTVEQzY2QzIyNjJDRUMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzA3OEU1RkNCMUM0MTFFRTkxRTVEQzY2QzIyNjJDRUMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6KUdWAAAAAkklEQVR42uzQAQEAAAQDMPTvfAposEVYJyl+o0CQIEGCBAkSJAhBggQJEiRIkCAECRIkSJAgQYIQJEiQIEGCBAkShCBBggQJEiRIEIIECRIkSJAgQQgSJEiQIEGCBAlCkCBBggQJEiQIQYIECRIkSJAgBAkSJEiQIEGCBCFIkCBBggQJEoQgQYIECRIkSBBnBRgAN5MDx69RQSQAAAAASUVORK5CYII=" width="1920" height="2160" data-src="/web/warmgreytail/main/prd-nav-${imgIndex}.jpg" alt="" class="lazy" /></div> 543 </div> 544 <div class="prd-nav-info"> 545 <div class="prd-nav-info-wrap"> 546 <div class="title desktop-only"> 547 <h2>PRODUCT NAVIGATOR</h2> 548 </div> 549 <div class="nav-info-slide nav-info-slide-${imgIndex}">${prdSlide.innerHTML}</div> 550 </div> 551 </div>`; 552 mainPrdWrap.innerHTML = navigatorTemplate; 553 554 document.querySelector(".main-prd-navigator .swiper-wrapper").append(mainPrdWrap); 555 556 let insideSwiper = new Swiper(document.querySelector(".nav-info-slide-" + imgIndex + " .prd-inner-swiper"), { 557 direction: "horizontal", 558 loop: false, 559 pagination: { 560 el: document.querySelector(".nav-info-slide-" + imgIndex + " .prd-inner-swiper .swiper-pagination"), 561 clickable: true, 562 }, 563 }); 564 565 swiperInsideNavigator.push(insideSwiper); 566 let lazyLoadInstance = new LazyLoad({}); 567 }); 568 569 // let swiperPrd = new Swiper(".prd-nav-swiper", { 570 // direction: "horizontal", 571 // loop: false, 572 // }); 573 574} 575makingNavigator(); 576 577 578/*ìíì´ë¯¸ì§ ë° ë©ì¸ì§ì´ìí 매í*/ 579// console.log('@@@@@@@',crPrdArray) 580crPrdArray.forEach((crPrdObj, index) => { 581 crPrdObj.forEach((obj, i) => { 582 const prdBtn = document.createElement("button"); 583 if (i == 0) { 584 prdBtn.classList.add("active"); 585 } 586 prdBtn.classList.add("prd-coord"); 587 prdBtn.style.top = obj.y + "%"; 588 prdBtn.style.left = obj.x + "%"; 589 prdBtn.dataset.prdId = obj.id; 590 prdBtn.setAttribute( 591 "onclick", 592 "findPrd(this, " + obj.id + ", " + (index + 1) + ")" 593 ); 594 595 document.querySelector('.main-prd-nav-wrap[data-cr-index="' + (index + 1) + '"] .prd-nav-img').append(prdBtn); 596 }); 597}); 598/*//ìíì´ë¯¸ì§ ë° ë©ì¸ì§ì´ìí 매í*/ 599 600/*ì¢í ë§ì»¤ íì±í ë° ì¬ë¼ì´ë ë³ê²½+íì´ì§ë¤ì´ì */ 601function findPrd(thisItem, prdId, index) { 602 const parent = thisItem.closest(".prd-nav-img"); 603 const activeItem = parent.querySelector("button.active"); 604 605 activeItem.classList.remove("active"); 606 thisItem.classList.add("active"); 607 608 const crSlider = document.querySelectorAll('.main-prd-nav-wrap[data-cr-index="' + index + '"] .prdList > li'); 609 crSlider.forEach((slide, i) => { 610 if (slide.dataset.crId == prdId) { 611 swiperInsideNavigator[index - 1].slideTo(i, 500, false); 612 } 613 }); 614} 615/* //ì¢í ë§ì»¤íì±í ë° ì¬ë¼ì´ë ë³ê²½+íì´ì§ë¤ì´ì */ 616 617/* //ìí ë¤ë¹ê²ì´í° ë§ë¤ê¸°*/ 618 619/*í ë°°ë ììëë§ íì±í */ 620const lineBanner = document.querySelector('.line-banner > div').getAttribute('pandassi-banner-group'); 621if (lineBanner !== 'disable') { 622 document.body.classList.add('top-banner'); 623} 624/*//í ë°°ë ììëë§ íì±í */ 625 626/*íë°°ë ì¤í¬ë¡¤ì ë¹ë ¸ì¶¢*/ 627if (document.body.className.indexOf('top-banner') > -1) { 628 let topH = document.querySelector('.main-line-banner-slider').clientHeight; 629 window.addEventListener('scroll', function () { 630 if (window.scrollY > topH) { 631 document.body.classList.remove('top-banner'); 632 } else { 633 document.body.classList.add('top-banner'); 634 } 635 }); 636} 637/*//íë°°ë ì¤í¬ë¡¤ì ë¹ë ¸ì¶¢*/ 638 639 640//ìí ì ë³´ í´ëì¤ ì£¼ê±°ë ìì ë³ê²½ì 641let infoInnerT = document.querySelectorAll('.ec-base-product .prdList li .description'); 642for (let j = 0; j < infoInnerT.length; j++) { 643 644 let firstIsFirst = infoInnerT[j].querySelectorAll('.spec > li'); 645 646 for (let i = 0; i < firstIsFirst.length; i++) { 647 // if(i==0) { 648 // firstIsFirst[0].classList.add('prd-info-first'); 649 // } 650 if (firstIsFirst[i].querySelector('.title span').textContent === 'í매ê°') { 651 firstIsFirst[i].classList.add('prd-info-first'); 652 } 653 if (firstIsFirst[i].querySelector('.title span').textContent === 'ìí ê°ëµì¤ëª ') { 654 firstIsFirst[i].classList.add('plp-summary'); 655 } 656 if (firstIsFirst[i].querySelector('.title span').textContent === 'í ì¸ê°' || firstIsFirst[i].querySelector('.title span').textContent === 'í ì¸í매ê°') { 657 firstIsFirst[i].classList.add('plp-sale'); 658 } 659 } 660 661} 662 663// mainSlide(); 664 665window.addEventListener("DOMContentLoaded", function () { 666 const bDiv = document.querySelectorAll('.banner-wrap > div'); 667 bDiv.forEach(banner => { 668 if (banner.querySelector('.tb-inner') !== null) { 669 banner.classList.add('text-banner'); 670 } 671 }); 672 673 var mAtag = document.querySelectorAll(".main-wrap a"); 674 for (var i = 0; i < mAtag.length; i++) { 675 if (mAtag[i].getAttribute("href") === "#!") { 676 mAtag[i].classList.add("no-link"); 677 } 678 } 679 680}); 681 682 683/* ë©ì¸ íë¤ì¨ ë°°ë ìì */ 684const loadVideoByPandassi = () => { 685 const bannerItems = document.querySelectorAll('.with-video-banner .banner-item'); 686 687 const loadVimeoVideo = (item) => { 688 const dataHtml = item.getAttribute('data-html'); 689 if (dataHtml && dataHtml.includes('vimeo')) { 690 item.classList.add('video-exist'); 691 const videoId = dataHtml.split('|')[1]; 692 const videoHtml = `
693 <iframe 694 src="https://player.vimeo.com/video/${videoId}?autoplay=1&loop=1&autopause=0&background=1" 695 frameborder="0" 696 allow="autoplay; fullscreen" 697 allowfullscreen> 698 </iframe>`; 699 // item.querySelector('a').style.backgroundImage = `url("https://vumbnail.com/${videoId}.jpg")`; 700 item.querySelector('a').innerHTML = videoHtml; 701 } 702 }; 703 704 const observer = new IntersectionObserver((entries, obs) => { 705 entries.forEach(entry => { 706 if (entry.isIntersecting) { 707 loadVimeoVideo(entry.target); 708 obs.unobserve(entry.target); // í ë² ì¤í í ë ì´ì ê°ì§íì§ ìì 709 } 710 }); 711 }, { 712 rootMargin: '200px 0px', // íë©´ ì/ìë 200px ë°ê¹¥ìì 미리 ì¤í 713 threshold: 0 // ììê° ì¡°ê¸ì´ë¼ë ê°ì§ëë©´ ì¤í 714 }); 715 716 bannerItems.forEach(item => observer.observe(item)); 717}; 718 719 720loadVideoByPandassi() 721/* //ë©ì¸ íë¤ì¨ ë°°ë ìì */ 722////////////////////////////////////// 723// Video-related.js - Desktop (Kor) // 724////////////////////////////////////// 725 726var vidSlider = []; 727var mainVidSlider = document.querySelectorAll('.vid-num'); 728var vidNums = []; 729 730function activeVideoSlide(){ 731 732 for (var i = 0; i < mainVidSlider.length; i++) { 733 vidNums.push(mainVidSlider[i].textContent); 734 var option = { 735 url: "https://vimeo.com/" + vidNums[i], 736 width: 300, 737 autoplay: false, 738 muted: true, 739 loop: true, 740 controls: false, 741 }; 742 mainVidSlider[i].innerHTML = ''; 743 var elemnNo = 'video' + i; 744 var videoWrapper = document.createElement('div'); 745 videoWrapper.id = elemnNo; 746 var vidActive = document.createElement('div'); 747 vidActive.className = 'vid-btn'; 748 749 mainVidSlider[i].setAttribute('onclick','vidOn('+ i +')'); 750 751 mainVidSlider[i].appendChild(vidActive); 752 mainVidSlider[i].appendChild(videoWrapper); 753 var video01Player = new Vimeo.Player(elemnNo, option); 754 var vidStatus = { 755 video : video01Player, 756 played : false, 757 } 758 vidSlider.push(vidStatus); 759 } 760} 761$(document).ready(function(){ 762 if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") { 763 var sShippingCountryCode4Cookie = 'shippingCountryCode'; 764 var bShippingCountryProc = false; 765 766 // ë°°ì¡êµê° ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 767 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) { 768 $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide(); 769 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide(); 770 } else { 771 $('.thumb .xans-layout-multishoplistitem').hide(); 772 var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)'); 773 if (typeof(aShippingCountryCode) != 'undefined' && aS
773hippingCountryCode != null && aShippingCountryCode.length > 2) { 774 var sShippingCountryValue = aShippingCountryCode[2]; 775 } 776 777 // query stringì¼ë¡ ëì´ ì¨ ë°°ì¡êµê° ê°ì´ ìë¤ë©´, ê·¸ ê°ì ì ì©í¨ 778 var aHrefCountryValue = decodeURIComponent(location.href).split("/?country="); 779 780 if (aHrefCountryValue.length == 2) { 781 var sShippingCountryValue = aHrefCountryValue[1]; 782 } 783 784 // ë©ì¸ íì´ì§ìì êµê°ì íì ìí ê²½ì°, ê·¸ ì¸ì íì´ì§ìì ì í ë ê°ì´ ì ëì¤ë íì ì²ë¦¬ 785 if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) { 786 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 787 788 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 789 $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 790 } 791 } 792 if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) { 793 sShippingCountryValue = sShippingCountryValue.split("#")[0]; 794 var bShippingCountryProc = true; 795 796 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 797 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 798 var expires = new Date(); 799 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 800 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 801 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 802 $("#f_country").val(sShippingCountryValue).change();; 803 } 804 } 805 } 806 // ì¸ì´ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 807 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) { 808 $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide(); 809 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide(); 810 } else { 811 $('.thumb .xans-layout-multishoplistitem').hide(); 812 } 813 814 // ë°°ì¡êµê° ë° ì¸ì´ ì¤ì ì´ ë ë¤ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 815 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) { 816 $(".xans-layout-multishopshipping").hide(); 817 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide(); 818 } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // ë°°ì¡êµê° ê°ì ì²ë¦¬í ì ì´ ìê³ , ë©ì¸íë©´ì¼ ëë§ ì í ë ì´ì´ë¥¼ ëì 819 var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(); 820 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 821 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 822 // ë°°ì¡êµê° ì íì ì¬ì©í´ì¼ ë ì´ì´ë¥¼ ë³´ì´ê² í¨ 823 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) { 824 $(".xans-layout-multishopshipping").show(); 825 } 826 } 827 828 $(".xans-layout-multishopshipping .close").bind("click", function() { 829 $(".xans-layout-multishopshipping").hide(); 830 }); 831 832 $(".xans-layout-multishopshipping .ec-base-button a").bind("click", function() { 833 var expires = new Date(); 834 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 835 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 836 837 // ëë©ì¸ 문ì ë¡ ì¿ í¤ë¡ ë°°ì¡êµê° ì¤ì ì´ ì ëë ê²½ì°ë¥¼ ìí´ query stringì¼ë¡ ë°°ì¡êµê° ê°
837ì ëê¹ 838 var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 839 840 location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting; 841 }); 842 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").bind("click", function() { 843 $(".xans-layout-multishopshipping").show(); 844 }); 845 } 846});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.