1(() => { 2 // í ì¬ë¼ì´ë 3 const tabItemsSwiper = new Swiper(".tab__lists", { 4 slidesPerView: 'auto', 5 spaceBetween: 4, 6 }); 7 8 const tabSwiper = new Swiper(".tab01_swiper", { 9 slidesPerView: 1, 10 spaceBetween: 8, 11 scrollbar: { 12 el: ".tab_swiper .swiper-scrollbar.list-scrollbar", 13 }, 14 observer: true, 15 observeParents: true, 16 }); 17 const tabSwiper02 = new Swiper(".tab02_swiper", { 18 slidesPerView: 1, 19 spaceBetween: 8, 20 scrollbar: { 21 el: ".tab02_swiper .swiper-scrollbar.list-scrollbar", 22 }, 23 observer: true, 24 observeParents: true, 25 }); 26 const tabSwiper03 = new Swiper(".tab03_swiper", { 27 slidesPerView: 1, 28 spaceBetween: 8, 29 scrollbar: { 30 el: ".tab03_swiper .swiper-scrollbar.list-scrollbar", 31 }, 32 observer: true, 33 observeParents: true, 34 }); 35 const tabSwiper04 = new Swiper(".tab04_swiper", { 36 slidesPerView: 1, 37 spaceBetween: 8, 38 scrollbar: { 39 el: ".tab04_swiper .swiper-scrollbar.list-scrollbar", 40 }, 41 observer: true, 42 observeParents: true, 43 }); 44 const tabSwiper05 = new Swiper(".tab05_swiper", { 45 slidesPerView: 1, 46 spaceBetween: 8, 47 scrollbar: { 48 el: ".tab05_swiper .swiper-scrollbar.list-scrollbar", 49 }, 50 observer: true, 51 observeParents: true, 52 }); 53 54 // tab 55 const tabsItems = document.querySelectorAll(".tab__item"); 56 const tabLists = document.querySelectorAll(".tab__cont"); 57 58 tabsItems.forEach((tab) => { 59 tab.addEventListener("click", () => { 60 const target = tab.getAttribute("data-tab"); 61 62 tabsItems.forEach((t) => t.classList.remove("active")); 63 tabLists.forEach((c) => c.classList.remove("active")); 64 65 tab.classList.add("active"); 66 document 67 .querySelector(`.tab__cont[data-content="${target}"]`) 68 .classList.add("active"); 69 }); 70 }); 71})(); 72// ìíì´ 1ê°ì¼ ê²½ì° one-itemí´ëì¤ ì¶ê° 73document.addEventListener('DOMContentLoaded', function () { 74 const productBlocks = document.querySelectorAll('.xans-product-listmain'); 75 76 productBlocks.forEach(function (block) { 77 const items = block.querySelectorAll('.list li.items'); 78 79 if (items.length === 1) { 80 block.classList.add('one-item'); 81 //console.log('one-item í´ëì¤ê° ì¶ê°ë ë¸ë¡:', block); 82 } else { 83 //console.log('í´ë¹ ë¸ë¡ì li.items ê°ì:', items.length); 84 } 85 }); 86}); 87 88// ìí íê·¸ ì¤í¬ë¦½í¸ 89const addTags = () => { 90 const tagBox = document.querySelectorAll('.tag_box:not(.tag_done)'); 91 // console.log(tagBox.length); 92 93 tagBox.forEach((el) => { 94 const tagInfo = el.querySelector('.listitem_ë©ì¸_íë¡ëª¨ì '); 95 96 // console.log(tagInfo); 97 if (tagInfo) { 98 const text = tagInfo.innerText.split(';'); 99 text.forEach((els) => { 100 // ë¶ëª¨ ìì를 ì íí©ëë¤. 101 const parentElement = el; 102 // ìë¡ì´ í그를 ìì±í©ëë¤. 103 const tagList = document.createElement('li'); 104 const tag = document.createElement('p'); 105 106 tagList.classList.add('tag_list'); 107 tag.classList.add('tags'); 108 109 el.appendChild(tagList).appendChild(tag); 110 111 tag.innerText = els; 112 }); 113 } 114 el.classList.add('tag_done'); 115 }); 116}; 117 118(()=>{ 119 // íë¹ ê´ë¦¬ë¥¼ ìí 첫걸ì 120 var setTypeSwiper02 = new Swiper(".jdbw_product_wrap .listmain_swiper", { 121 slidesPerView: 1, 122 autoplay: { 123 delay: 2500, 124 disableOnInteraction: false, 125 }, 126 loop: true, 127 }); 128 129 // ë©ì¸íì´ì§ Product Set 130 var setTypeSwiper = new Swiper(".set_type_swiper", { 131 slidesPerView: 2.4, 132 spaceBetween: 8, 133 scrollbar: { 134 el: ".set_type_scrollbar", 135 }, 136 }); 137 138 // ë©ì¸íì´ì§ ë² ì¤í¸ì ë¬ 139 const best = document.querySelector(".best_list"); 140 if(best) { 141 // ë² ì¤í¸ ì¬ë¼ì´ë 142 const bestSwiper = new Swiper(".best_swiper",{ 143 spaceBetween: 8, 144 slidesPerView: 2.4, 145 scrollbar: { 146 el: ".best-scrollbar", 147 }, 148 }); 149 150 const best_item = best.querySelectorAll(".list_content .list .items:not(.best_done)"); 151 152 best_item.forEach(function (els, index) { 153 var listCount = els.querySelector('.list_count'); 154 listCount.textContent = (index + 1).toString(); 155
156 // 첫 ë²ì§¸, ë ë²ì§¸, ì¸ ë²ì§¸ ìì´í ì í´ëì¤ ë¶ì¬ 157 if (index < 3) { 158 let className; 159 switch (index) { 160 case 0: 161 className = "first"; 162 break; 163 case 1: 164 className = "second"; 165 break; 166 case 2: 167 className = "thrid"; 168 break; 169 } 170 els.classList.add(className); 171 } 172 els.classList.add("best_done"); 173 }); 174 } 175 176 // íìë ìì´í ìì ë³ê²½ 177 const tsWrap = document.querySelector('.event_sale'); 178 const tsList = tsWrap?.querySelector('.timeSale-swiper .list'); 179 if (tsList) { 180 const tsItems = Array.from(tsList.querySelectorAll('.items')); 181 182 if (tsItems.length > 0) { 183 const tdNow = dayjs(); // íìë ê¸°ì¤ íì¬ ìê° 184 185 const getTdInfo = (item) => { 186 const tdPromoEl = item.querySelector('.promotion'); 187 if (!tdPromoEl) return { phase: 3, startMs: 0 }; // ì ë³´ ìì¼ë©´ 맨 ë¤ 188 189 const tdStartAttr = tdPromoEl.dataset.start; // data-start 190 const tdEndAttr = tdPromoEl.dataset.end; // data-end 191 192 let tdPhase = 3; // 0:ì§í, 1:ìì , 2:ì¢ ë£, 3:기í 193 let tdStartMoment = null; // dayjs ê°ì²´ 194 195 if (tdStartAttr) { 196 tdStartMoment = dayjs(tdStartAttr, "YYYY-MM-DD HH:mm"); 197 } 198 199 if (tdStartAttr && tdEndAttr) { 200 const tdStartTime = dayjs(tdStartAttr, "YYYY-MM-DD HH:mm"); 201 const tdEndTime = dayjs(tdEndAttr, "YYYY-MM-DD HH:mm"); 202 203 if (tdNow.isBefore(tdStartTime)) { 204 tdPhase = 1; // ìì 205 } else if (tdNow.isBefore(tdEndTime)) { 206 tdPhase = 0; // ì§íì¤ 207 } else { 208 tdPhase = 2; // ì¢ ë£ 209 } 210 } else if (tdPromoEl.classList.contains('timeout')) { 211 tdPhase = 2; // timeout íìë ì¢ ë£ 212 } 213 214 return { 215 phase: tdPhase, 216 startMs: tdStartMoment ? tdStartMoment.valueOf() : 0 217 }; 218 }; 219 220 tsItems.sort((a, b) => { 221 const infoA = getTdInfo(a); 222 const infoB = getTdInfo(b); 223 224 // 1ìì: ì§íìí(phase) ê¸°ì¤ ì ë ¬ 225 if (infoA.phase !== infoB.phase) return infoA.phase - infoB.phase; 226 227 // ë ë¤ ì¢ ë£(phase 2)ë©´ â ìµê·¼ ì¢ ë£ë ììëë¡ (startMs í° ê² ìì¼ë¡) 228 if (infoA.phase === 2 && infoB.phase === 2) { 229 return infoB.startMs - infoA.startMs; 230 } 231 232 // ë머ì§ë ìì ìê° ì´ë¥¸ ìì¼ë¡ 233 return infoA.startMs - infoB.startMs; 234 }); 235 236 tsItems.forEach((item) => tsList.appendChild(item)); 237 } 238 } 239 240 241 // ë©ì¸íì´ì§ íìë 242 const timeSaleSlide = document.querySelectorAll( 243 ".timeSale-swiper .swiper-slide" 244 ).length; 245 246 if(timeSaleSlide > 0) { 247 let timeSaleOptions = {}; 248 249 if (timeSaleSlide == 1) { 250 timeSaleOptions = { 251 spaceBetween: 0, 252 slidesPerView: 1, 253 }; 254 } else { 255 timeSaleOptions = { 256 spaceBetween: 10, 257 slidesPerView: 1.3, 258 /*autoplay: { 259 delay: 2500, 260 disableOnInteraction: false, 261 }, 262 loop: true,*/ 263 }; 264 } 265 266 const timeSaleSwiper = new Swiper(".timeSale-swiper", timeSaleOptions); 267 } 268 269 270 // ë©ì¸íì´ì§ íí 1 ë°°ë 271 const benefitSlide = document.querySelectorAll('.benefit_swiper .swiper-slide').length; 272 273 if(benefitSlide > 0) { 274 let benefitOptions = {}; 275 276 if(benefitSlide == 1) { 277 benefitOptions = { 278 loop: false, 279 pagination: { 280 el: ".benefit-pagination", 281 type: "bullets", 282 }, 283 } 284 } else { 285 benefitOptions = { 286 loop: true, 287 pagination: { 288 el: ".benefit-pagination", 289 type: "bullets", 290 }, 291 autoplay: { 292 delay:2500, 293 disableOnInteraction: false, 294 }, 295 } 296 } 297 298 const benefitSwiper = new Swiper(".benefit_swiper", benefitOptions); 299 } 300 301 302 // ë©ì¸íì´ì§ íí 2 ë°°ë 303 const benefitSlide2 = document.querySelectorAll('.benefit_swiper2 .swiper-slide').length; 304 305 if(benefitSlide2 > 0) { 306 let benefitOptions2 = {}; 307 308 if(benefitSlide2 == 1) { 309 benefitOptions2 = { 310 loop: false, 311 pagination: { 312 el: ".benefit-pagination2", 313 type: "bullets", 314 }, 315 } 316 } else { 317 benefitOptions2 = { 318 loop: true, 319 autoplay: { 320 delay:2500, 321 disableOnInteraction: false, 322 }, 323 pagination: { 324 el: ".benefit-pagination2", 325 type: "bullets", 326 }, 327 } 328 } 329 330 const benefitSwiper2 = new Swiper(".benefit_swiper2", benefitOptions2); 331 } 332 333 334 // ë©ì¸íì´ì§ ë§¤ê±°ì§ ë°°ë 335 const mazSlide = document.querySelectorAll('.maz_board_swiper .swiper-slide').length; 336 337 if(mazSlide > 0) { 338 let mazOption = {}; 339 340 if(mazSlide == 1) { 341 mazOption = { 342 loop: false, 343 } 344 } else { 345 mazOption = { 346 slidesPerView: 1.5, 347 loop: false, 348 spaceBetween: 12, 349 autoplay: false, 350 } 351 } 352 353 const mazSwiper = new Swiper(".maz_board_swiper", mazOption); 354 } 355 356 357 358 // ë©ì¸ ìë¨ ìí ë°°ë 359 const mainSwiper = new Swiper(".main_banner_swiper",{ 360 pagination: { 361 el: ".swiper-main-pagination", 362 }, 363 loop: true, 364 autoplay: { 365 delay:2500, 366 disableOnInteraction: false, 367 }, 368 }); 369 370 // íì¼íìì ë´¤ë ê·¸ ì í 371 const charllaSlide = document.querySelectorAll( 372 ".charlla_swiper .swiper-slide" 373 ).length;
374 let charllaOptions = {}; 375 376 if (charllaSlide == 1) { 377 charllaOptions = { 378 loop: false, 379 }; 380 } else { 381 charllaOptions = { 382 slidesPerView: 1.5, 383 loop: false, 384 spaceBetween: 8, 385 autoplay: false, 386 }; 387 } 388 389 const charllaSwiper = new Swiper(".charlla_swiper", charllaOptions); 390 391 // ë©ì¸ video ì¹ì 392 const mainVideoSwiper = new Swiper(".main_video_swiper",{ 393 pagination: { 394 el: ".video_swiper-main-pagination", 395 type: "fraction", 396 }, 397 loop: true, 398 }); 399 400 401 402 // listmain í ì¸ì¨ ì ì. 403 404 var regex = /[^0-9]/g; 405 var comma = /\B(?=(\d{3})+(?!\d))/g; 406 407 // 문ìì´ => ì«ìë§ ì¶ë ¥ => replace(regex, ""); 408 // ì«ì => ì¸ì리 ì½¤ë§ => replace(comma, ""); 409 // mobile - í ì¸ë ê°ê²© 9,500ì 410 // pc - í ì¸ëë ê°ê²© 500ì 411 // custom - ìë¹ìê° 10000 - 기본ê°ê²© (í ì¸ì ê°ê²©) 412 // price - íë§¤ê° 10000 - í ì¸ëê°ê²© (ê¸ì¡ì¡°ì íê°ê²©) 413 // salePrice - í ì¸ëê°ê²© 9500 414 // discount - í ì¸ì¨ 5% 415 416 const items = document.querySelectorAll(".list .items .price_box"); 417 items.forEach((el) => { 418 419 420 let promotionMobile = Number(el.dataset.mobile.replace(regex, "")); 421 let promotionPc = Number(el.dataset.pc.replace(regex, "")); 422 let promotionTest = el.dataset.test; 423 let custom = Number(el.dataset.custom); 424 let price = Number(el.dataset.price); 425 426 if(!custom) { 427 custom = price; 428 } 429 if (promotionTest) { 430 if(price === custom) { 431 const salePrice = Number(promotionTest.replace(regex,"")); // í ì¸ë ê°ê²© 432 const discount = (100 - Math.round(salePrice/price*100)).toString() + "%"; // í ì¸ì¨ 433 const per = document.createElement("p"); 434 const customPrice = document.createElement("p"); 435 customPrice.classList.add("custom"); 436 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 437 per.classList.add("per"); 438 per.innerText = discount; 439 el.querySelector(".prices").appendChild(customPrice); 440 el.querySelector(".prices").appendChild(per); 441 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 442 } else { 443 const salePrice = Number(promotionTest.replace(regex,"")); // í ì¸ë ê°ê²© 444 const discount = (100 - Math.round(salePrice/custom*100)).toString() + "%"; // í ì¸ì¨ 445 const customPrice = document.createElement("p"); 446 customPrice.classList.add("custom"); 447 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 448 const per = document.createElement("p"); 449 per.classList.add("per"); 450 per.innerText = discount; 451 el.querySelector(".prices").appendChild(customPrice); 452 el.querySelector(".prices").appendChild(per); 453 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 454 } 455 } else { 456 if(price === custom) { // íë§¤ê° ìë¹ìê° ì°¨ì´ ìì ê²½ì°. 457 if(!promotionMobile && !promotionPc) { 458 return; 459 } 460 if(promotionMobile) { // 모ë°ì¼ í ì¸ê°. 461 const salePrice = promotionMobile; // í ì¸ë ê°ê²© 462 const discount = (100 - Math.round(salePrice/price*100)).toString() + "%"; // í ì¸ì¨ 463 const per = document.createElement("p"); 464 const customPrice = document.createElement("p"); 465 customPrice.classList.add("custom"); 466 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 467 per.classList.add("per"); 468 per.innerText = discount; 469 el.querySelector(".prices").appendChild(customPrice); 470 el.querySelector(".prices").appendChild(per); 471 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 472 } else { // PC í ì¸ê° - ì´ ë¶ë¶ ìì íìµëë¤. 473 /*const salePrice = price - promotionPc; // í ì¸ë ê°ê²©
474 const discount = (100 - Math.round(salePrice/price*100)).toString() + "%"; 475 const customPrice = document.createElement("p"); 476 customPrice.classList.add("custom"); 477 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 478 const per = document.createElement("p"); 479 per.classList.add("per"); 480 per.innerText = discount; 481 el.querySelector(".prices").appendChild(customPrice); 482 el.querySelector(".prices").appendChild(per); 483 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì";*/ 484 const salePrice = price; 485 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 486 } 487 } else if (price !== custom) { // íë§¤ê° ìë¹ìê° ì°¨ì´ ìì ê²½ì°. 488 if(promotionMobile) { // 모ë°ì¼ í ì¸ê°. 489 const salePrice = promotionMobile; // í ì¸ë ê°ê²© 490 const discount = (100 - Math.round(salePrice/custom*100)).toString() + "%"; // í ì¸ì¨ 491 const customPrice = document.createElement("p"); 492 customPrice.classList.add("custom"); 493 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 494 const per = document.createElement("p"); 495 per.classList.add("per"); 496 per.innerText = discount; 497 el.querySelector(".prices").appendChild(customPrice); 498 el.querySelector(".prices").appendChild(per); 499 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 500 } else { // PC í ì¸ê° 501 //const salePrice = price - promotionPc; // í ì¸ë ê°ê²© 502 const salePrice = price; // í ì¸ë ê°ê²© 503 const discount = (100 - Math.round(salePrice/custom*100)).toString() + "%"; 504 const customPrice = document.createElement("p"); 505 customPrice.classList.add("custom"); 506 customPrice.innerText = custom.toString().replace(comma, ",") + "ì"; 507 const per = document.createElement("p"); 508 per.classList.add("per"); 509 per.innerText = discount; 510 el.querySelector(".prices").appendChild(customPrice); 511 el.querySelector(".prices").appendChild(per); 512 el.querySelector(".prices .price").innerText = salePrice.toString().replace(comma, ",") + "ì"; 513 } 514 } 515 } 516 }); 517 518 519 // íìë ìê° ê³ì° 520 const times = []; 521 const calc = (seconds) => { // ì´ë¥¼ ì¼,ì,ë¶,ì´ ë¡ ê³ì° 522 const allHour = parseInt(seconds / 3600); 523 const day = String(Math.floor(allHour / 24)).padStart(2, "0"); 524 const hour = String((allHour % 24) + parseInt(day) * 24).padStart(2, "0"); 525 const min = String(Math.floor((seconds % 3600) / 60)).padStart(2, "0"); 526 const sec = String(seconds % 60).padStart(2, "0"); 527 return `${hour} : ${min} : ${sec}`; 528 }; 529 const promotion = document.querySelectorAll(".list .items .promotion"); // ìíì promotion class 530 531 532 const currentDate = dayjs(); 533 534 if (promotion && promotion.length > 0) { 535 promotion.forEach((el, index) => { 536 const start = el.dataset.start; // ììì¼ data ê° 537 const end = el.dataset.end; // ì¢ ë£ì¼ dataê° 538 const startTime = dayjs(start, "YYYY-MM-DD HH:mm"); 539 const endTime = dayjs(end, "YYYY-MM-DD HH:mm"); 540 541 // ì¤ë ë ì§ê° ì´ë²¤í¸ ìì ë ì§ ì´ì ì¸ì§ íì¸ 542 if (currentDate.isBefore(startTime)) { 543 const dateTime = dayjs(startTime, { format: 'YYYY-MM-DD HH:mm' }); 544 const startMonth = dateTime.format('M'); 545 const startDay = dateTime.format('D'); 546 547 el.querySelector('.timer').textContent = startMonth + "/" + startDay + ' OPEN'; 548 el.classList.add("timeout"); 549 550 // ìì ì ì¸ ê²½ì° price_box ë¯¸ë ¸ì¶ 551 const itemsElement = el.closest('.items'); // promotion í´ëì¤ì ê°ì¥ ê°ê¹ì´ items ì¡°ì ìì 찾기 552 if (itemsElement) { 553 const priceBoxElement = itemsElement.querySelector('.price_box'); 554 if (priceBoxElement) { 555 priceBoxElement.style.display = 'none'; 556 } 557 } 558 } else if (currentDate.isBefore(endTime)) { 559 // ì´ë²¤í¸ê° ìì ì¤ì¸ ê²½ì° 560 const remaining = endTime.diff(currentDate, "s"); 561 562 times[index] = { 563 elementL: el, 564 remaining: remaining, 565 interval: null, 566 }; 567 568 times[index].interval = setInterval(() => { 569 const startTime = el.dataset.start; // ììì¼ dataê° 570 let start = Math.abs(dayjs(startTime, "YYYY-MM-DD HH:mm").diff(dayjs(), "s")); // ììì¼ 571 let full = remaining + start; // ì´ íë¡ëª¨ì ê¸°ê° (ì´ë¨ì) 572 times[index].remaining -= 1;
572 // 1ì´ê° ì§ë ëë§ë¤ 1ì´ì© ê°ìí기ìí´ -1 573 let text = ''; // ë¨ì ìê° text 574 575 if (times[index].remaining > 0) { // íë¡ëª¨ì ê¸°ê° ì§íì¤ 576 text = calc(times[index].remaining); // ì´ë¨ìì ë¨ììê°ì ì¼ ì ë¶ ì´ë¡ 문ìì´ 577 } else { // íë¡ëª¨ì ê¸°ê° ì¢ ë£ 578 el.querySelector(".timer").innerHTML = `íìë ì¢ ë£! <span>ë¤ì 기íì ë§ëì :)</span>`; // íë¡ëª¨ì ìì ì 579 el.classList.add("timeout"); 580 el.closest('.items').querySelector(".basket_icons").classList.add('timeOut'); 581 /*ì¥ë°êµ¬ë ë¯¸ë ¸ì¶*/ 582 // el.parentNode.querySelectorAll(".basket_icons")[0].style.display = "none"; 583 clearInterval(times[index].interval); 584 } 585 el.querySelector(".timer").innerHTML = `${text}<span>ë¨ì</span>`; 586 }, 1000); 587 } else { 588 // ì´ë²¤í¸ê° ì¢ ë£ë ê²½ì° 589 console.log(el); 590 el.querySelector(".timer").innerHTML = `íìë ì¢ ë£! <span>ë¤ì 기íì ë§ëì :)</span>`; // íë¡ëª¨ì ìì ì 591 el.classList.add("timeout"); 592 el.closest('.items').querySelector(".basket_icons").classList.add('timeOut'); 593 } 594 }); 595 } 596 597 // ìí íê·¸ ì¤í¬ë¦½í¸ 598 addTags(); 599})(); 600(() => { 601 var regex = /[^0-9]/g; 602 var comma = /\B(?=(\d{3})+(?!\d))/g; 603 const items = document.querySelectorAll(".list_content .items:not(.one_done)"); 604 605 606 items.forEach(el => { 607 const name = el.querySelector(".name"); // ìí ì´ë¦ 608 const one_price = el.querySelector(".day_price:not(.displaynone) .one_price"); // ìí íëë¹ ê°ê²© 609 610 // ìí ì´ë¦ [] ë¶ë¶ ììë³ê²½ 611 if (name) { 612 // ìì ë´ë¶ì HTML ë´ì©ì ê°ì ¸ìµëë¤. 613 let htmlContent = name.innerHTML; 614 615 // [ ] ìì ìë í ì¤í¸ë¥¼ íìì¼ë¡ ë³ê²½í©ëë¤. 616 htmlContent = htmlContent.replace(/\[(.*?)\]/g, '<span style="color: #212121">[$1]</span>'); 617 618 // ë³ê²½ë ë´ì©ì ììì ë¤ì í ë¹í©ëë¤. 619 name.innerHTML = htmlContent; 620 } 621 622 if(one_price) { 623 let one_number = Number(one_price.innerText.replace(regex, "")); 624 625 // ìí ê°ê²© 626 let price = el.querySelector(".price"); 627 price = Number(price.innerText.replace(regex, "")); 628 629 // íëë¹ ê°ê²© 630 let day_price = price / one_number 631 day_price = Math.floor(day_price); // ììì ì´í를 ë²ë¦° ì ìë¡ ë³í 632 633 one_price.innerHTML = day_price.toString().replace(comma, ",") + "ì"; 634 } 635 636 el.classList.add('one_done'); 637 }); 638})(); 639(() => { 640 let wish = $(".wishIcon"); 641 let wish_popup_content = $(".xans-myshop-layerwish"); 642 let wish_popup_text = wish_popup_content.find(".wish_popup .content > p"); 643 644 645 wish_popup_content.css("display", "none"); 646 647 wish.each(function () { 648 649 $(this).click(function() { 650 let wish_pop = $(this).find("img").attr("icon_status"); 651 652 if (wish_pop === "on") { 653 wish_popup_text.text("ê´ì¬ìí 목ë¡ìì ìì ëììµëë¤."); 654 wish_popup_content.css("display", "block"); 655 } else { 656 wish_popup_text.text("ìíì´ ê´ì¬ìíì ì ì¥ëììµëë¤."); 657 wish_popup_content.css("display", "block"); 658 } 659 }) 660 }) 661}) (); 662 663(() => { 664 var keyword = $("#keyword"); 665 var keyword_class = $(".inputTypeText"); 666 keyword.attr("placeholder", "âì ìí'ì ê²ìí´ë³´ì¸ì!"); 667 668 669 // urlì ê°ì ¸ì¤ê¸° 670 // decodeURI = í¤ìëê° íê¸ì¼ ê²½ì° íê¸ë¡ ë³í 671 var keyword_href = decodeURI(window.location.href); 672 const url = new URL(keyword_href); 673 const urlParams = url.searchParams; 674 675 // ê²ìì´(í¤ìë) 찾기
676 let keyword_item = urlParams.get('keyword') 677 678 679 if ((urlParams.has('keyword'))) { 680 // ê²ìì´(í¤ìë) valueì ì¶ê° 681 keyword_class.val(keyword_item) 682 } else { 683 return 684 } 685 686 687 /* ìì½ íëë¹ ê°ê²© */ 688 const dayPrice = () => { 689 var regex = /[^0-9]/g; 690 var comma = /\B(?=(\d{3})+(?!\d))/g; 691 const items = document.querySelectorAll(".search_items >li"); 692 693 items.forEach(el => { 694 const name = el.querySelector(".name"); // ìí ì´ë¦ 695 const one_price = el.querySelector(".day_price:not(.displaynone) .one_price"); // ìí íëë¹ ê°ê²© 696 697 // ìí ì´ë¦ [] ë¶ë¶ ììë³ê²½ 698 if (name) { 699 // ìì ë´ë¶ì HTML ë´ì©ì ê°ì ¸ìµëë¤. 700 let htmlContent = name.innerHTML; 701 702 // [ ] ìì ìë í ì¤í¸ë¥¼ íìì¼ë¡ ë³ê²½í©ëë¤. 703 htmlContent = htmlContent.replace(/\[(.*?)\]/g, '<span style="color: #212121">[$1]</span>'); 704 705 // ë³ê²½ë ë´ì©ì ììì ë¤ì í ë¹í©ëë¤. 706 name.innerHTML = htmlContent; 707 } 708 709 if(one_price) { 710 let one_number = Number(one_price.innerText.replace(regex, "")); 711 712 // ìí ê°ê²© 713 let price = el.querySelector(".price"); 714 715 price = Number(price.innerText.replace(regex, "")); 716 717 718 // íëë¹ ê°ê²© 719 let day_price = price / one_number 720 day_price = Math.floor(day_price); // ììì ì´í를 ë²ë¦° ì ìë¡ ë³í 721 722 one_price.innerHTML = day_price.toString().replace(comma, ",") + "ì"; 723 } 724 725 el.classList.add('done'); 726 }); 727 }; 728 729 // ìì½ íëë¹ ê°ê²© ì¤í¬ë¦½í¸ 730 dayPrice(); 731})(); 732 733 734$(function(){ 735 const searchBtn = $("button.search"); 736 const searchPop = $(".search_popup"); 737 const searchCont = $(".search_content"); 738 const searchClose = $("#header .search_close"); 739 740 searchBtn.click(function(){ 741 $("#header .search").hide(); 742 searchClose.show(); 743 searchPop.fadeIn(300,function(){ 744 $("body").addClass("lock"); 745 }).addClass("on"); 746 searchCont.slideDown(500); 747 }); 748 749 searchPop.click(function(event) { 750 if (!searchCont.is(event.target) && searchCont.has(event.target).length === 0) { 751 searchCont.slideUp(500); 752 searchPop.fadeOut(300,function(){ 753 $(this).removeClass("on"); 754 $("body").removeClass("lock"); 755 }); 756 $("#header .search").show(); 757 searchClose.hide(); 758 } 759 }); 760 761 searchClose.click(function(){ 762 searchCont.slideUp(500); 763 searchPop.fadeOut(300,function(){ 764 $(this).removeClass("on"); 765 $("body").removeClass("lock"); 766 }); 767 $("#header .search").show(); 768 searchClose.hide(); 769 }); 770}); 771 772document.addEventListener("DOMContentLoaded",()=>{ 773 774 // ìµê·¼ê²ìì´ 775 const search = document.getElementById("keyword"); 776 const searchForm = document.getElementById("searchForm"); 777 const searchDelAll = document.querySelector(".btnDeleteAll"); 778 let recentArr = JSON.parse(localStorage.getItem("recent_keywords") || "[]"); 779 780 const recentList = document.querySelector(".recent_list"); 781 const recentEmpty = document.querySelector(".empty"); 782 783 if(recentList){ 784 785 if(recentArr.length > 0){ 786 recentArr = recentArr.slice(0,10); 787 recentArr.forEach(el => { 788 const keyword = document.createElement("li"); 789 const link = document.createElement("a"); 790 const delBtn = "<button class=\"btnDelete\"></button>"; 791 792 keyword.className = "recent_keyword"; 793 link.href = "/product/search.html?keyword=" + el.replace(" ", "+"); 794 link.textContent = el; 795 keyword.append(link); 796 keyword.innerHTML += delBtn; 797 recentList.append(keyword); 798 }); 799 }else{ 800 recentEmpty.classList.remove("displaynone"); 801 recentList.classList.add("displaynone"); 802 searchDelAll.classList.add("displaynone"); 803 } 804 805 recentList.querySelectorAll(".recent_keyword").forEach(el => { 806 el.addEventListener("click", ()=>{ 807 const thisText = el.querySelector("a").textContent; 808 const idx = recentArr.indexOf(thisText); 809 if (idx > -1) recentArr.splice(idx, 1); 810 recentArr.unshift(thisText); 811 const recentArrString = JSON.stringify(recentArr); 812 localStorage.setItem("recent_keywords", recentArrString); 813 }); 814 }); 815 816 recentList.querySelectorAll(".btnDelete").forEach(el => { 817 el.addEventListener("click", (e)=>{ 818 e.stopPropagation(); 819 el.closest("li.recent_keyword").remove(); 820 const thisText = el.closest("li.recent_keyword").querySelector("a").textContent; 821 const idx = recentArr.indexOf(thisText); 822 if (idx > -1) { 823 recentArr.splice(idx, 1); 824 localStorage.setItem("recent_keywords", JSON.stringify(recentArr)); 825 } 826 827 if(recentArr.length === 0){ 828 recentEmpty.classList.remove("displaynone"); 829 recentList.classList.add("displaynone"); 830 searchDelAll.classList.add("displaynone"); 831 } 832 }); 833 }); 834 835 searchDelAll.addEventListener("click",()=>{ 836 837 document.querySelectorAll(".recent_keyword").forEach(el => { 838 el.remove(); 839 }); 840 841 recentArr = []; 842 localStorage.setItem("recent_keywords", JSON.stringify(recentArr)); 843 recentEmpty.classList.remove("displaynone"); 844 recentList.classList.add("displaynone"); 845 searchDelAll.classList.add("displaynone"); 846 847 }); 848 849 } 850 851 852// searchForm.addEventListener("submit",()=>{ 853 854 if(search.value && search.value !== ""){ 855 if(recentArr.length > 0){ 856 if(recentArr.includes(search.value)){ 857 const idx = recentArr.indexOf(search.value); 858 if (idx > -1) recentArr.splice(idx, 1); 859 } 860 recentArr.unshift(search.value); 861 }else{ 862 recentArr.push(search.value); 863 } 864 865 const recentArrString = JSON.stringify(recentArr); 866 localStorage.setItem("recent_keywords", recentArrString); 867 } 868 869// }); 870 871 872 // ì¸ê¸°ê²ìì´ ìì 873 const hotKeywordsList = document.querySelector(".xans-search-hotkeyword"); 874 if(hotKeywordsList){ 875 const hotKeywords = hotKeywordsList.querySelectorAll(".tag_list"); 876 if(hotKeywords.length > 0){ 877 if(hotKeywords.length === 1 && hotKeywords[0].textContent.replace(" ","") === ""){ 878 hotKeywordsList.closest(".mark_box").classList.add("displaynone"); 879 }else{ 880 hotKeywords.forEach((el, idx) => { 881 el.setAttribute("data-index", idx + 1); 882 }); 883 } 884 } 885 } 886}); 887(function($){ 888 $.fn.extend({ 889 center: function() { 890 this.each(function() { 891 var 892 $this = $(this), 893 $w = $(window); 894 $this.css({ 895 position: "absolute", 896 top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px", 897 left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px" 898 }); 899 }); 900 return this; 901 } 902 }); 903 $(function() { 904 var $container = function(){/* 905 <div id="modalContainer"> 906 <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe> 907 </div>'); 908 */}.toString().slice(14,-3); 909 $('body') 910 .append($('<div id="modalBackpanel"></div>')) 911 .append($($container)); 912 function closeModal () { 913 $('#modalContainer').hide(); 914 $('#modalBackpanel').hide(); 915 } 916 $('#modalBackpanel').on('click',closeModal); 917 zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) { 918 var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup; 919 $('#modalContent').attr('src', $url); 920 $('#modalContent').on("load",function(){ 921 $(".header .close",this.contentWindow.document.body).on("click", closeModal); 922 }); 923 $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show(); 924 $('#modalContainer').center().show(); 925 } 926 }); 927})(jQuery); 928//window popup script 929function winPop(url) {
930 window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no"); 931} 932/** 933 * document.location.href split 934 * return array Param 935 */ 936function getQueryString(sKey) 937{ 938 var sQueryString = document.location.search.substring(1); 939 var aParam = {}; 940 941 if (sQueryString) { 942 var aFields = sQueryString.split("&"); 943 var aField = []; 944 for (var i=0; i<aFields.length; i++) { 945 aField = aFields[i].split('='); 946 aParam[aField[0]] = aField[1]; 947 } 948 } 949 950 aParam.page = aParam.page ? aParam.page : 1; 951 return sKey ? aParam[sKey] : aParam; 952}; 953 954$(function(){ 955 // tab 956 $.eTab = function(ul){ 957 $(ul).find('a').on('click', function(){ 958 var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'), 959 _target = $(this).attr('href'), 960 _siblings = '.' + $(_target).attr('class'); 961 $(_target).show().siblings(_siblings).hide(); 962 return false 963 }); 964 } 965 if ( window.call_eTab ) { 966 call_eTab(); 967 }; 968}); 969 970document.addEventListener("DOMContentLoaded",()=>{ 971 document.body.childNodes.forEach(node => { 972 if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '>'){ 973 //node.remove(); 974 } 975 }); 976}); 977// ì¸ë¤ì¼ ì´ë¯¸ì§ ìë°ì¼ê²½ì° ê¸°ë³¸ê° ì¤ì 978$(window).on('load', function() { 979 980 $(".thumbnail img, img.thumbImage, img.bigImage").each(function($i,$item){ 981 var $img = new Image(); 982 $img.onerror = function () { 983 $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif"; 984 } 985 $img.src = this.src; 986 }); 987 988}); 989 990$(function(){ 991 // í ê¸ 992 $('div.eToggle .title').off('click').on('click', function(){ 993 var toggle = $(this).parent('.eToggle'); 994 if(toggle.hasClass('disable') === false){ 995 $(this).parent('.eToggle').toggleClass('selected') 996 } 997 }); 998 999 $('dl.eToggle dt').on('click', function(){ 1000 $(this).toggleClass('selected'); 1001 $(this).next('dd').toggleClass('selected'); 1002 }); 1003 1004 //ì¥ë°êµ¬ë íì´ì§ ìëí¼ Type ë³ê²½ 1005 $('[id^="quantity"]').each(function() { 1006 $(this).get(0).type = 'tel'; 1007 }); 1008 1009 // 모ë°ì¼ìì ê³µê¸ì¬ í ì´ë¸ th ê°ì ì¡°ì 1010 $('.xans-mall-supplyinfo, .supplyInfo').find('table > colgroup').find('col').eq(0).width(98); 1011 $('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'}); 1012 1013 /** 1014 * ë©ì¸ì¹´í ê³ ë¦¬ toggle 1015 */ 1016 $('.xans-product-listmain h2').on('click', function() { 1017 var bClosed = !!$(this).data('is_closed'); 1018 var sUrl; 1019 if (bClosed) { 1020 sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_close.gif"; 1021 } else { 1022 sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_open.gif"; 1023 } 1024 $(this).css('background-image', 'url("'+ sUrl +'")'); 1025 $(this).siblings().toggle(); 1026 $(this).parent().find('div.ec-base-paginate').toggle(); 1027 $(this).parent().next('div.xans-product-listmore').toggle(); 1028 $(this).data('is_closed', !bClosed); 1029 }); 1030 1031 /* base header ê²ì ë ì´ì´ */ 1032 $('#layout .header').find('.search .btnSearch').on('click', function(){ 1033 var $baseHeader = $('#layout .header'); 1034 $baseHeader.addClass('open'); 1035 $('#dimmedSlider').one('click', function(){ 1036 $baseHeader.removeClass('open'); 1037 }); 1038 }); 1039 1040 /** 1041 * ìë¨íë²í¼ 1042 */ 1043 var globalTopBtnScrollFunc = function() { 1044 // íë²í¼ ê´ë ¨ë³ì 1045 var $btnTop = $('#btnTop'); 1046 1047 $(window).on('scroll', function() { 1048 try { 1049 var iCurScrollPos = $(this).scrollTop(); 1050 1051 if (iCurScrollPos > ($(this).height() / 2)) { 1052 $btnTop.fadeIn('fast'); 1053 } else { 1054 $btnTop.fadeOut('fast'); 1055 } 1056 } catch(e) { } 1057 }); 1058 }; 1059 1060 /** 1061 * 구매ë²í¼ 1062 */ 1063 var globalBuyBtnScrollFunc = function() { 1064 // 구매ë²í¼ ê´ë ¨ë³ì 1065 var sFixId = $('#orderFixItem').length > 0 ? 'orderFixItem' : 'fixedActionButton', 1066 $area = $('#orderFixArea'), 1067 $item = $('#' + sFixId + '').not($area); 1068 1069 $(window).on('scroll', function(){ 1070 try { 1071 // 구매ë²í¼ ê´ë ¨ë³ì
1072 var iCurrentHeightPos = $(this).scrollTop() + $(this).height(), 1073 iButtonHeightPos = $item.offset().top; 1074 1075 if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) { 1076 if (iButtonHeightPos < $(this).scrollTop() - $item.height()) { 1077 $area.fadeIn('fast'); 1078 } else { 1079 $area.hide(); 1080 } 1081 } else { 1082 $area.fadeIn('fast'); 1083 } 1084 } catch(e) { } 1085 }); 1086 }; 1087 1088 globalTopBtnScrollFunc(); 1089 globalBuyBtnScrollFunc(); 1090}); 1091 1092// ê³µíµë ì´ì´íì ì¤í 1093var globalLayerOpenFunc = function(_this) { 1094 this.id = $(_this).data('id'); 1095 this.param = $(_this).data('param'); 1096 this.basketType = $('#basket_type').val(); 1097 this.url = $(_this).data('url'); 1098 this.layerId = 'ec_temp_mobile_layer'; 1099 this.layerIframeId = 'ec_temp_mobile_iframe_layer'; 1100 1101 var _this = this; 1102 1103 function paramSetUrl() { 1104 if (this.param) { 1105 // if isset param 1106 } else { 1107 this.url = this.basketType ? this.url + '?basket_type=' + this.basketType : this.url; 1108 } 1109 }; 1110 1111 if (this.url) { 1112 window.ecScrollTop = $(window).scrollTop(); 1113 $.ajax({ 1114 url : this.url, 1115 success : function (data) { 1116 if (data.indexOf('404 íì´ì§ ìì') == -1) { 1117 // ìë¤ë©´ ìì 1118 try { $(_this).remove(); } catch ( e ) { } 1119
1120 var $layer = $('<div>', { 1121 html: $("<iframe>", { src: _this.url, id: _this.layerIframeId, scrolling: 'auto', css: { width: '100%', height: '100%', overflowY: 'auto', border: 0 } } ), 1122 id: _this.layerId, 1123 css : { position: 'absolute', top: 0, left:0, width: '100%', height: $(window).height(), 'z-index': 9999 } 1124 }); 1125 1126 $('body').append($layer); 1127 $('html, body').css({'overflowY': 'hidden', height: '100%', width: '100%'}); 1128 $('#' + this.layerId).show(); 1129 } 1130 } 1131 }); 1132 } 1133}; 1134 1135// ê³µíµë ì´ì´íì ë«ê¸° 1136var globalLayerCloseFunc = function() { 1137 this.layerId = 'ec_temp_mobile_layer'; 1138 1139 if (window.parent === window) 1140 self.close(); 1141 else { 1142 parent.$('html, body').css({'overflowY': 'auto', height: 'auto', width: '100%'}); 1143 parent.$('html, body').scrollTop(parent.window.ecScrollTop); 1144 parent.$('#' + this.layerId).remove(); 1145 } 1146}; 1147 1148/** 1149 * document.location.href split 1150 * return array Param 1151 */ 1152var getQueryString = function(sKey) 1153{ 1154 var sQueryString = document.location.search.substring(1); 1155 var aParam = {}; 1156 1157 if (sQueryString) { 1158 var aFields = sQueryString.split("&"); 1159 var aField = []; 1160 for (var i=0; i<aFields.length; i++) { 1161 aField = aFields[i].split('='); 1162 aParam[aField[0]] = aField[1]; 1163 } 1164 } 1165 1166 aParam.page = aParam.page ? aParam.page : 1; 1167 return sKey ? aParam[sKey] : aParam; 1168}; 1169 1170// PCë²ì ë°ë¡ ê°ê¸° 1171var isPCver = function() { 1172 var sUrl = window.location.hostname; 1173 var aTemp = sUrl.split("."); 1174 1175 var pattern = /^(mobile[\-]{2}shop[0-9]+)$/; 1176 1177 if (aTemp[0] == 'm' || aTemp[0] == 'skin-mobile' || aTemp[0] == 'mobile') { 1178 sUrl = sUrl.replace(aTemp[0]+'.', ''); 1179 } else if (pattern.test(aTemp[0]) === true) { 1180 var aExplode = aTemp[0].split('--'); 1181 aTemp[0] = aExplode[1]; 1182 sUrl = aTemp.join('.'); 1183 } 1184 window.location.href = '//'+sUrl+'/?is_pcver=T'; 1185}; 1186 1187/* ëìë§ */ 1188$('body').on('click', '.ec-base-tooltip-area .eTip', function(e){ 1189 var findArea = $($(this).parents('.ec-base-tooltip-area')); 1190 var findTarget = $($(this).siblings('.ec-base-tooltip')); 1191 var findTooltip = $('.ec-base-tooltip'); 1192 $('.ec-base-tooltip-area').removeClass('show'); 1193 $(this).parents('.ec-base-tooltip-area').first().addClass('show'); 1194 findTooltip.hide(); 1195 findTarget.show(); 1196 e.preventDefault(); 1197}); 1198 1199$('body').on('click', '.ec-base-tooltip-area .eClose', function(e){ 1200 var findTarget = $(this).parents('.ec-base-tooltip').first(); 1201 $('.ec-base-tooltip-area').removeClass('show'); 1202 findTarget.hide(); 1203 e.preventDefault(); 1204}); 1205 1206$('.ec-base-tooltip-area').find('input').on('focusout', function() { 1207 var findTarget = $(this).parents('.ec-base-tooltip-area').find('.ec-base-tooltip'); 1208 $('.ec-base-tooltip-area').removeClass('show'); 1209 findTarget.hide(); 1210}); 1211 1212/** 1213 * íì ì°½ì 리ì¬ì´ì¦ ê´ë ¨ 1214 */ 1215 1216function setResizePopup() { 1217 1218 if(!$('#popup').length) return; 1219 1220 var iWrapWidth = $('#popup').width(); 1221 var iWrapHeight = $('#popup').height(); 1222 1223 var iWindowWidth = $(window).width(); 1224 var iWindowHeight = $(window).height(); 1225 1226 window.resizeBy(iWrapWidth - iWindowWidth, iWrapHeight - iWindowHeight); 1227} 1228setResizePopup(); 1229 1230// íì íì´ì§ ë¡ëê° ìë£ë íì 리ì¬ì´ì§ í¨ì를 ë¤ì í¸ì¶ 1231$( window ).on('load', function() { 1232 setResizePopup(); 1233}); 1234/** 1235 * ìì§ì´ë ë°°ë Jquery Plug-in 1236 * @author cafe24 1237 */ 1238 1239(function($){ 1240 1241 $.fn.floatBanner = function(options) { 1242 options = $.extend({}, $.fn.floatBanner.defaults , options); 1243 1244 return this.each(function() { 1245 var aPosition = $(this).position(); 1246 var jbOffset = $(this).offset(); 1247 var node = this; 1248 1249 $(window).on('scroll', function() { 1250 var _top = $(document).scrollTop(); 1251 _top = (aPosition.top < _top) ? _top : aPosition.top; 1252 1253 setTimeout(function () { 1254 var newinit = $(document).scrollTop(); 1255 1256 if ( newinit >
1256 jbOffset.top ) { 1257 _top -= jbOffset.top; 1258 var container_height = $("#wrap").height(); 1259 var quick_height = $(node).height(); 1260 var cul = container_height - quick_height; 1261 if(_top > cul){ 1262 _top = cul; 1263 } 1264 } else { 1265 _top = 0; 1266 } 1267 1268 $(node).stop().animate({top: _top}, options.animate); 1269 }, options.delay); 1270 }); 1271 }); 1272 }; 1273 1274 $.fn.floatBanner.defaults = { 1275 'animate' : 500, 1276 'delay' : 500 1277 }; 1278 1279})(jQuery); 1280 1281/** 1282 * 문ì 구ëí ìì 1283 */ 1284$(function(){ 1285 $('#banner:visible, #quick:visible').floatBanner(); 1286 1287 //placeholder 1288 $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){ 1289 var placeholderName = $(this).parents().attr('title'); 1290 $(this).attr("placeholder", placeholderName); 1291 }); 1292 /* placeholder ie8, ie9 */ 1293 $.fn.extend({ 1294 placeholder : function() { 1295 //IE 8 ë²ì ìë hasPlaceholderSupport() ê°ì´ false를 ë¦¬í´ 1296 if (hasPlaceholderSupport() === true) { 1297 return this; 1298 } 1299 //hasPlaceholderSupport() ê°ì´ false ì¼ ê²½ì° ìë ì½ë를 ì¤í 1300 return this.each(function(){ 1301 var findThis = $(this); 1302 var sPlaceholder = findThis.attr('placeholder'); 1303 if ( ! sPlaceholder) { 1304 return; 1305 } 1306 findThis.wrap('<label class="ePlaceholder" />'); 1307 var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : ''; 1308 findThis.before('<span' + sDisplayPlaceHolder + '>' + sPlaceholder + '</span>'); 1309 this.onpropertychange = function(e){ 1310 e = event || e; 1311 if (e.propertyName == 'value') { 1312 $(this).trigger('focusout'); 1313 } 1314 }; 1315 //ê³µíµ class 1316 var agent = navigator.userAgent.toLowerCase(); 1317 if (agent.indexOf("msie") != -1) { 1318 $(".ePlaceholder").css({"position":"relative"}); 1319 $(".ePlaceholder span").css({"position":"absolute", "padding":"0 4px", "color":"#878787"}); 1320 $(".ePlaceholder label").css({"padding":"0"}); 1321 } 1322 }); 1323 } 1324 }); 1325 1326 $(':input[placeholder]').placeholder(); //placeholder() í¨ì를 í¸ì¶ 1327 1328 //í´ë¦íë©´ placeholder ì¨ê¹ 1329 $('body').on('click', '.ePlaceholder span', function(){ 1330 $(this).hide(); 1331 }); 1332 1333 //inputì°½ í¬ì»¤ì¤ ì¸ ì¼ë placeholder ì¨ê¹ 1334 $('body').on('focusin', '.ePlaceholder :input', function(){ 1335 $(this).prev('span').hide(); 1336 }); 1337 1338 //inputì°½ í¬ì»¤ì¤ ìì ì¼ë value ê° true ì´ë©´ ì¨ê¹, false ì´ë©´ ë³´ì¬ì§ 1339 $('body').on('focusout', '.ePlaceholder :input', function(){ 1340 if (this.value) { 1341 $(this).prev('span').hide(); 1342 } else { 1343 $(this).prev('span').show(); 1344 } 1345 }); 1346 1347 //inputì placeholderê° ì§ìì´ ëë©´ true를 ìëë©´ false를 리í´ê°ì¼ë¡ ëì ¸ì¤ 1348 function hasPlaceholderSupport() { 1349 if ('placeholder' in document.createElement('input')) { 1350 return true; 1351 } else { 1352 return false; 1353 } 1354 } 1355}); 1356 1357/** 1358 * ì¸ë¤ì¼ ì´ë¯¸ì§ ìë°ì¼ê²½ì° ê¸°ë³¸ê° ì¤ì 1359 */ 1360$(window).on('load', function() { 1361 $("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){ 1362 var $img = new Image(); 1363 $img.onerror = function () { 1364 $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif"; 1365 } 1366 $img.src = this.src; 1367 }); 1368}); 1369 1370/** 1371 * tooltip 1372 */ 1373$('.eTooltip').each(function(i){ 1374 $(this).find('.btnClose').attr('tabIndex','-1'); 1375}); 1376//tooltip input focus 1377$('.eTooltip').find('input').on('focus', function() { 1378 var targetName = returnTagetName(this); 1379 targetName.siblings('.ec-base-tooltip').show(); 1380}); 1381$('.eTooltip').find('input').on('focusout', function() { 1382 var targetName = returnTagetName(this); 1383 targetName.siblings('.ec-base-tooltip').hide(); 1384}); 1385function returnTagetName(_this){ 1386 var ePlacename = $(_this).parent().attr("class"); 1387 var targetName; 1388 if(ePlacename == "ePlaceholder"){ //ePlaceholder ëì 1389 targetName = $(_this).parents(); 1390 }else{ 1391 targetName = $(_this); 1392 } 1393 return targetName; 1394} 1395
1396/** 1397 * eTab 1398 */ 1399$("body").on("click", ".eTab a", function(e){ 1400 // í´ë¦í li ì selected í´ëì¤ ì¶ê°, 기존 liì ìë selected í´ëì¤ë ìì . 1401 var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"), 1402 _target = $(this).attr("href"), 1403 _siblings = $(_target).attr("class"), 1404 _arr = _siblings.split(" "), 1405 _classSiblings = "."+_arr[0]; 1406 1407 //í´ë¦í íì í´ë¹íë ììë íì±í, 기존 ììë ë¹íì±í í¨. 1408 $(_target).show().siblings(_classSiblings).hide(); 1409 1410 1411 //preventDefault ë a íê·¸ ì²ë¼ í´ë¦ ì´ë²¤í¸ ì¸ì ë³ëì ë¸ë¼ì°ì íëì ë§ê¸° ìí´ ì¬ì©ë¨. 1412 e.preventDefault(); 1413}); 1414 1415 1416 1417(() => { 1418 1419 function adjustContentsHeight() { 1420 const headerHeight = document.getElementById('header')?.offsetHeight || 0; 1421 const navHeight = document.querySelector('.bottom_nav')?.offsetHeight || 0; 1422 const footerHeight = document.getElementById('footer')?.offsetHeight || 0; 1423 const container = document.getElementById('contents'); 1424 1425 if(!container) { 1426 return; 1427 } 1428 1429 const viewportHeight = window.innerHeight; 1430 1431 const containerMinHeight = viewportHeight - headerHeight - navHeight - footerHeight; 1432 1433 container.style.minHeight = containerMinHeight + 'px'; 1434 } 1435 1436 // íì´ì§ ë¡ë ì ì´ê¸° ë·°í¬í¸ ì¡°ì ìì ìí 1437 window.addEventListener('load', adjustContentsHeight); 1438 1439 1440})(); 1441(()=>{ 1442 let loading = $(".loading"); 1443 1444 loading.fadeOut(1000,"linear"); 1445})(); 1446(() => { 1447 var lastScroll = 0; 1448 var headerInner = $("#header").innerHeight(); 1449 const linearBanner = $(".linear_banner"); 1450 1451 if(linearBanner.length > 0) { 1452 $('#wrap').addClass('hasBanner'); 1453 } else { 1454 $('#wrap').removeClass('hasBanner'); 1455 } 1456 1457 $(window).scroll(function(event){ 1458 var st = $(this).scrollTop(); 1459 1460 // 맨ììì 1pxë§ ìì§ì¬ë headerê° íë©´ìì ì¬ë¼ì§ë íì ë°©ì§ 1461 if ( st < headerInner) { 1462 $('#wrap').removeClass('up'); 1463 } 1464 //ë´ë ¤ê°ë 1465 else if (st > lastScroll) { 1466 $('#wrap').addClass('up'); 1467 } 1468 //ì¬ë¼ê°ë 1469 else { 1470 $('#wrap').removeClass('up'); 1471 } 1472 1473 lastScroll = st; 1474 }); 1475 1476 /* ë ë°°ë í ê¸*/ 1477 const bannerClose = $(".banner_close"); 1478 bannerClose.click(function () { 1479 linearBanner.slideToggle(400); 1480 linearBanner.toggleClass('nonDisplay'); 1481 $('#wrap').toggleClass('nonBanner'); 1482 }); 1483 1484 /* navigation swiper */ 1485 var navSwiper = new Swiper(".nav_swiper", { 1486 slidesPerView: "auto", 1487 freeMode: true, 1488 }); 1489 1490 /* linearSwiper */ 1491 const topBanner = document.querySelectorAll(".linear_banner"); 1492 1493 if(topBanner.length > 0){ 1494 1495 topBanner.forEach(el => { 1496 if(el.querySelectorAll(".swiper-slide").length > 1) { 1497 var linearSwiper = new Swiper(el,{ 1498 direction: 'vertical', 1499 slidesPerVIew: 1, 1500 loop: true, 1501 autoplay : { 1502 delay : 3000, 1503 disableOnInteraction : false, 1504 }, 1505 speed: 500, 1506 }); 1507 } 1508 }); 1509 } 1510 /* navigation on ê¸°ë¥ */ 1511 const hrefs = window.location.href; 1512 const naviList = document.querySelectorAll(".navigation .list .items"); 1513 console.log("url : " +hrefs); 1514 1515 naviList.forEach(el => { 1516 const el_link = el.querySelector("a").href; 1517 console.log("link : " +el_link); 1518 1519 if(hrefs.includes(el_link)) { 1520 el.classList.add("on"); 1521 } 1522 }); 1523}) (); 1524(()=>{ 1525 /* ì¬ì´ëë©ë´ on/off */ 1526 let menu = $("aside.sidemenu"); 1527 let sideContent = $(".side_content"); 1528 let bottomMenu = $(".bottom_nav .link.category"); 1529 let menuClose = menu.find(".menu_close"); 1530 let headerMenu = $(".header_menu"); 1531 1532 menu.click(function(event) { 1533 if (!sideContent.is(event.target) && sideContent.has(event.target).length === 0) { 1534 menu.fadeOut(300); 1535 menu.find(".side_content").animate({left: '-100%'}); 1536 $("body").removeClass("lock"); 1537 } 1538 }); 1539 1540 menuClose.click(function(){ 1541 menu.fadeOut(300); 1542 menu.find(".side_content").animate({left: '-100%'}); 1543 $("body").removeClass("lock"); 1544 }); 1545 1546 bottomMenu.click(function(){ 1547 menu.fadeIn(300); 1548 menu.find(".side_content").animate({left: '0%'}, 500); 1549 $("body").addClass("lock"); 1550 }); 1551 1552 headerMenu.click(function(){ 1553 menu.fadeIn(300); 1554 menu.find(".side_content").animate({left: '0%'}, 500); 1555 $("body").addClass("lock"); 1556 }); 1557})(); 1558 1559 1560/* 2depth ê¹ì§ë§ ë ¸ì¶ */ 1561$(function(){ 1562 1563 var methods = { 1564 aCategory : [], 1565 aSubCategory : {}, 1566 1567 get: function() 1568 { 1569 $.ajax({ 1570 url : '/exec/front/Product/SubCategory', 1571 dataType: 'json', 1572 success: function(aData) { 1573 if (aData == null || aData == 'undefined') return; 1574 for (var i=0; i<aData.length; i++) 1575 { 1576 var sParentCateNo = aData[i].parent_cate_no; 1577 1578 if (!methods.aSubCategory[sParentCateNo]) { 1579 methods.aSubCategory[sParentCateNo] = []; 1580 } 1581 1582 methods.aSubCategory[sParentCateNo].push( aData[i] ); 1583 } 1584 // ìë¸ ì¹´í ê³ ë¦¬ë¥¼ ìì±í íìë 첫 ë²
1584째 ì¹´í ê³ ë¦¬ë¥¼ íìíëë¡ ìë ì½ë ì¶ê° 1585 methods.generateSubCategory(); 1586 } 1587 }); 1588 }, 1589 1590 generateSubCategory: function() { 1591 // ì´ í¨ìë ìë¸ ì¹´í ê³ ë¦¬ë¥¼ 미리 ìì±í©ëë¤. 1592 // íì´ì§ê° ë¡ëë ë í¸ì¶ë©ëë¤. 1593 // 모ë ì¹´í ê³ ë¦¬ì ëí ìë¸ ì¹´í ê³ ë¦¬ë¥¼ ìì±íëë¡ ìì 1594 1595 $('.xans-layout-category li').each(function() { 1596 var $this = $(this); 1597 var iCateNo = Number(methods.getParam($this.find('a').attr('href'), 'cate_no')); 1598 1599 if (!iCateNo) { 1600 iCateNo = Number(methods.getParamSeo($this.find('a').attr('href'))); 1601 } 1602 1603 if (iCateNo) { 1604 methods.show($this, iCateNo); 1605 } 1606 }); 1607 }, 1608 1609 getParam: function(sUrl, sKey) { 1610 var aUrl = sUrl.split('?'); 1611 var sQueryString = aUrl[1]; 1612 var aParam = {}; 1613 1614 if (sQueryString) { 1615 var aFields = sQueryString.split("&"); 1616 var aField = []; 1617 for (var i=0; i<aFields.length; i++) { 1618 aField = aFields[i].split('='); 1619 aParam[aField[0]] = aField[1]; 1620 } 1621 } 1622 return sKey ? aParam[sKey] : aParam; 1623 }, 1624 1625 getParamSeo: function(sUrl) { 1626 var aUrl = sUrl.split('/'); 1627 var len = aUrl.length-2; 1628 1629 return aUrl[len] ? aUrl[len] : null; 1630 }, 1631 1632 show: function (overNode, iCateNo) { 1633 1634 if (methods.aSubCategory.hasOwnProperty(iCateNo) === false) { 1635 return; 1636 } 1637 1638 var aHtml = []; 1639 aHtml.push('<ul>'); 1640 $(methods.aSubCategory[iCateNo]).each(function() { 1641 aHtml.push('<li><a href="/' + this.design_page_url + this.param + '">'+this.name+'</a></li>'); 1642 }); 1643 aHtml.push('</ul>'); 1644 1645 1646 var offset = $(overNode).offset(); 1647 $('<div class="sub-category"></div>') 1648 .appendTo(overNode) 1649 .html(aHtml.join('')) 1650 .find('li').on({ 1651 mouseover: function(e) { 1652 $(this).addClass('over'); 1653 }, 1654 mouseout: function(e) { 1655 $(this).removeClass('over'); 1656 } 1657 }); 1658 }, 1659 1660 close: function() { 1661 $('.sub-category').remove(); 1662 } 1663 }; 1664 1665 // ì´ê¸°ì ìë¸ ì¹´í ê³ ë¦¬ë¥¼ ìì± 1666 methods.get(); 1667 1668 // íì´ì§ ë¡ë ì 모ë ìë¸ ì¹´í ê³ ë¦¬ë¥¼ ìì± 1669 methods.generateSubCategory(); 1670 1671 1672 var regex = /[^0-9]/g; 1673 var comma = /\B(?=(\d{3})+(?!\d))/g; 1674 const items = document.querySelectorAll(".list_content.sidemenu_list_content .items:not(.one_done)"); 1675 1676 1677 items.forEach(el => { 1678 const name = el.querySelector(".name"); // ìí ì´ë¦ 1679 const one_price = el.querySelector(".day_price:not(.displaynone) .one_price"); // ìí íëë¹ ê°ê²© 1680 1681 // ìí ì´ë¦ [] ë¶ë¶ ììë³ê²½ 1682 if (name) { 1683 // ìì ë´ë¶ì HTML ë´ì©ì ê°ì ¸ìµëë¤. 1684 let htmlContent = name.innerHTML; 1685 1686 // [ ] ìì ìë í ì¤í¸ë¥¼ íìì¼ë¡ ë³ê²½í©ëë¤. 1687 htmlContent = htmlContent.replace(/\[(.*?)\]/g, '<span style="color: #929292">[$1]</span>'); 1688 1689 // ë³ê²½ë ë´ì©ì ììì ë¤ì í ë¹í©ëë¤. 1690 name.innerHTML = htmlContent; 1691 } 1692 1693 if(one_price) { 1694 let one_number = Number(one_price.innerText.replace(regex, "")); 1695 1696 // ìí ê°ê²© 1697 let price = el.querySelector(".price"); 1698 price = Number(price.innerText.replace(regex, "")); 1699 1700 // íëë¹ ê°ê²© 1701 let day_price = price / one_number 1702 day_price = Math.floor(day_price); // ììì ì´í를 ë²ë¦° ì ìë¡ ë³í 1703 1704 one_price.innerHTML = day_price.toString().replace(comma, ",") + "ì"; 1705 } 1706 1707 el.classList.add('one_done'); 1708 }); 1709}); 1710(() => { 1711 /* 1depth toggle */ 1712 $('.custom_category').not($('.menu_title.active').siblings('.custom_category')).hide(); 1713 $('.menu_title').click(function(event){ 1714 if($(this).next('.custom_category').length > 0) { 1715 event.preventDefault(); 1716 1717 $('.menu_title').not(this).removeClass('active'); 1718 $(this).toggleClass('active'); 1719 1720 $(this).next('.custom_category').slideToggle(400); 1721 $('.custom_category').not($(this).siblings('.custom_category')).slideUp(); 1722 } 1723 }); 1724 1725 $('.side_title, .toggle_img').click(function(e) { 1726 if (!$(this).siblings('.sub-category').length) return; 1727 1728 // .side_titleì ìí .side_listì 'active' í´ëì¤ ì¶ê°/ì ê±° 1729 $(this).closest('.side_list').toggleClass('active'); 1730 1731 // ë¤ë¥¸ .side_listìì 'active' í´ëì¤ ì ê±° 1732 $('.side_list').not($(this).closest('.side_list')).removeClass('active'); 1733 1734 e.preventDefault(); 1735 $(this).siblings('.sub-category').slideToggle(); 1736 $('.sub-category').not($(this).siblings('.sub-category')).slideUp(); 1737 1738 }); 1739 setTimeout(function() { 1740 document.querySelectorAll('.side_list').forEach(function(sideList) { 1741 var subElement = sideList.querySelector('.sub-category'); 1742 var toggleImg = sideList.querySelector('.toggle_img'); 1743 1744 // .sub-category ììê° ìì¼ë©´ toggle_imgì display: block 1745 if (subElement && toggleImg) { 1746 toggleImg.style.display = 'block'; 1747 } 1748 }); 1749 }, 500); 1750})(); 1751 1752(() => { 1753 const company = $("#footer .company"); 1754 company.find(".tit").on("click", function () { 1755 company.find(".tit").toggleClass("on"); 1756 company.find(".info").slideToggle(500); 1757 }); 1758 1759 // ìë¨ ì¤í¬ë¡¤ 1760 const topBtn = document.querySelector(".upBtn"); 1761 1762 topBtn?.addEventListener("click", function () { 1763 window.scrollTo({ top: 0, behavior: "smooth" }); 1764 }); 1765})();
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.