1function setColumnHeight() { 2 var headerH = $('.jsTopBanner').length > 0 ? $('.jsTopBanner').outerHeight() + $('.header').outerHeight() : $('.header').outerHeight(); 3 var winH = $(window).outerHeight(); 4 if ($(window).width() > 1023) { 5 $('.about__section').css('height', winH - headerH + 'px'); 6 } else { 7 $('.about__section').removeAttr('style'); 8 } 9} 10 11function setAboutImg() { 12 var imgSrc = $('.about__img').find('img').attr('src'); 13 $('.about__column--banner').attr('style', 'background-image: url(' + imgSrc + ');'); 14} 15 16function scrollEft() { 17 18 $('.about__section').each(function (idx) { 19 var cutLine = $(this).offset().top - ($(window).outerHeight() * 0.7); 20 if ($(window).scrollTop() >= cutLine && idx != 0) { 21 $(this).addClass('on'); 22 } 23 }); 24} 25 26$(function () { 27 28 var repeat = setInterval(function () { 29 30 if ($('.about').find('img').length > 0) { 31 32 clearInterval(repeat); 33 34 setTimeout(function () { 35 setAboutImg(); 36 $('.about__section').eq(0).addClass('on'); 37 }, 500); 38 39 setColumnHeight(); 40 $(window).on('resize', setColumnHeight); 41 $(window).on('scroll', scrollEft); 42 } 43 44 }); 45 46 47}); 48/** 49 * hasClass 50 */ 51function hasClass(element, className){ 52 return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1; 53}; 54 55/** 56 * toggle 57 */ 58function toggleClassAll(element, handler, className){ 59 var _handler = document.querySelector(handler); 60 document.querySelectorAll(handler).forEach(function(item){ 61 item.addEventListener('click', function(){ 62 var _element = item.parentNode; 63 if ( hasClass( _element, className ) ) { 64 _element.classList.remove( className ); 65 } else { 66 _element.classList.add( className ); 67 } 68 }) 69 }) 70}; 71 72/** 73 * findElements 74 */ 75function findElements(element, findElement){ 76 var resultElements = []; 77 document.querySelectorAll(element).forEach(function(item){ 78 var findElementList = item.querySelectorAll(findElement); 79 findElementList = Array.prototype.slice.call(findElementList); 80 resultElements = resultElements.concat(findElementList); 81 }) 82 return resultElements; 83}; 84 85/** 86 * setAttributeAl 87 */ 88function setAttributeAll(elements, name, value){ 89 elements.forEach(function(item){ 90 item.setAttribute(name, value); 91 }) 92}; 93 94/** 95 * ìí ì¬ë¤ì¼ ë¡ëëì§ ìì ê²½ì°, ê¸°ë³¸ê° ì¤ì 96 */ 97function setDefaultImage(element) { 98 document.querySelectorAll(element).forEach(function(item){ 99 var $img = new Image(); 100 $img.onerror = function () { 101 item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif"; 102 } 103 $img.src = item.src; 104 }); 105}; 106 107/** 108 * tooltip 109 */ 110function setTooltipEvent(){ 111 var input = findElements('.eTooltip', 'input'); 112 input.forEach(function(item){ 113 item.addEventListener('focusin', function(event){ 114 var targetName = returnTargetName(event.target); 115 targetName.nextElementSibling.style.display = 'block' 116 }); 117 item.addEventListener('focusout', function(event){ 118 var targetName = returnTargetName(event.target); 119 targetName.nextElementSibling.style.display = 'none' 120 }); 121 }); 122} 123 124/** 125 * tooltip input focus 126 */ 127function returnTargetName(_this){ 128 var ePlacename = _this.parentElement.getAttribute("class"); 129 var targetName; 130 if(ePlacename == "ePlaceholder"){ //ePlaceholder supported 131 targetName = _this.parentElement; 132 }else{ 133 targetName = _this; 134 } 135 return targetName; 136} 137 138/** 139 * window load 140 */ 141window.addEventListener('load', function(){ 142 if (document.querySelector('.thumbnail')){ 143 setDefaultImage('.thumbnail img'); 144 } 145 if (document.querySelector('.eTooltip')){ 146 setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1'); 147 setTooltipEvent(); 148 } 149 if (document.querySelector('div.eToggle')){ 150 toggleClassAll(false, 'div.eToggle .title', 'selected'); 151 } 152});
153//window popup script 154function winPop(url) { 155 window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no"); 156} 157/** 158 * document.location.href split 159 * return array Param 160 */ 161function getQueryString(sKey) 162{ 163 var sQueryString = document.location.search.substring(1); 164 var aParam = {}; 165 166 if (sQueryString) { 167 var aFields = sQueryString.split("&"); 168 var aField = []; 169 for(var i=0; i<aFields.length; i++){ 170 aField = aFields[i].split('='); 171 aParam[aField[0]] = aField[1]; 172 } 173 } 174 175 aParam.page = aParam.page ? aParam.page : 1; 176 return sKey ? aParam[sKey] : aParam; 177}; 178 179/** 180 * 구매ë²í¼ 181*/ 182var globalBuyBtnScrollFunc = function() { 183 // 구매ë²í¼ ê´ë ¨ë³ì 184 var sFixId = $('#orderFixItem').length > 0 ? 'orderFixItem' : 'fixedActionButton', 185 $area = $('#orderFixArea'), 186 $item = $('#' + sFixId + '').not($area); 187 188 $(window).scroll(function(){ 189 try { 190 // 구매ë²í¼ ê´ë ¨ë³ì 191 var iCurrentHeightPos = $(this).scrollTop() + $(this).height(), 192 iButtonHeightPos = $item.offset().top; 193 194 if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) { 195 if (iButtonHeightPos < $(this).scrollTop() - $item.height()) { 196 $area.fadeIn('fast'); 197 } else { 198 $area.hide(); 199 } 200 } else { 201 $area.fadeIn('fast'); 202 } 203 } catch(e) { } 204 }); 205}; 206 207$(function(){ 208 // tab 209 $.eTab = function(ul) { 210 $(ul).find('a').on('click', function() { 211 var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'), 212 _target = $(this).attr('href'), 213 _siblings = '.' + $(_target).attr('class'); 214 $(_target).show().siblings(_siblings).hide(); 215 return false 216 }); 217 } 218 if ( window.call_eTab ) { 219 call_eTab(); 220 }; 221 globalBuyBtnScrollFunc(); 222}); 223/** 224 * ì¹´í ê³ ë¦¬ ë§ì°ì¤ ì¤ë² ì´ë¯¸ì§ 225 * ì¹´í ê³ ë¦¬ ìë¸ ë©ë´ ì¶ë ¥ 226 */ 227 228$(document).ready(function () { 229 230 var cateData; 231 var methods = { 232 aCategory: [], 233 aSubCategory: {}, 234 235 get: function () { 236 $.ajax({ 237 url: '/exec/front/Product/SubCategory', 238 dataType: 'json', 239 success: function (aData) { 240 241 cateData = aData; 242 243 if (aData == null || aData == 'undefined') return; 244 for (var i = 0; i < aData.length; i++) { 245 var sParentCateNo = aData[i].parent_cate_no; 246 247 if (!methods.aSubCategory[sParentCateNo]) { 248 methods.aSubCategory[sParentCateNo] = []; 249 } 250 251 methods.aSubCategory[sParentCateNo].push(aData[i]); 252 } 253 254 var eventMenu = $('.category__item.jsMenuEvent'); 255 var eventMenuSide = $('.aside-category__item.jsMenuEvent'); 256 var hasEventChild = false; 257 var childData = ''; 258 259 if(eventMenu.length > 0) { 260 cateData.forEach(function (val, idx) { 261 if (val.name.indexOf('ì´ë²¤í¸') != -1) { 262 if(val.parent_cate_no != 1) { 263 if(val.name.indexOf('ì§í') != -1) { 264 var eventName = eventMenu.find('a').text(); 265 var eventURL = '/event/list.html' + val.param; eventMenu.find('a').attr('href', eventURL).text(eventName); 266 eventMenu.removeClass('displaynone'); 267 eventMenuSide.find('a').attr('href', eventURL).text(eventName); 268 eventMenuSide.removeClass('displaynone'); 269 } 270 } 271 hasEventChild = true; 272 } 273 }); 274 } 275 276 } 277 }); 278 }, 279 280 getParam: function (sUrl, sKey) { 281 282 var aUrl = sUrl.split('?'); 283 var sQueryString = aUrl[1]; 284 var aParam = {}; 285
286 if (sQueryString) { 287 var aFields = sQueryString.split("&"); 288 var aField = []; 289 for (var i = 0; i < aFields.length; i++) { 290 aField = aFields[i].split('='); 291 aParam[aField[0]] = aField[1]; 292 } 293 } 294 return sKey ? aParam[sKey] : aParam; 295 }, 296 297 getParamSeo: function (sUrl) { 298 var aUrl = sUrl.split('/'); 299 return aUrl[3] ? aUrl[3] : null; 300 }, 301 302 show: function (overNode, iCateNo) { 303 304 if(methods.aSubCategory[iCateNo]) { 305 if (methods.aSubCategory[iCateNo].length == 0) { 306 return; 307 } 308 309 310 var aHtml = []; 311 aHtml.push('<ul class="sub-category__list">'); 312 $(methods.aSubCategory[iCateNo]).each(function () { 313 aHtml.push('<li class="sub-category__item"><a class="sub-category__link jsChildTwo" href="' + this.link_product_list + '">' + this.name + '</a></li>'); 314 }); 315 aHtml.push('</ul>'); 316 317 318 var offset = $(overNode).offset(); 319 $('<div class="sub-category"></div>') 320 .appendTo(overNode) 321 .html(aHtml.join('')).addClass('on'); 322 setTimeout(function() { 323 $(overNode).find('.sub-category').removeClass('on'); 324 },200); 325 } 326 }, 327 328 close: function () { 329 $('.sub-category').remove(); 330 } 331 }; 332 333 methods.get(); 334 335 $('.xans-layout-category.category li.jsPrdCate').mouseenter(function (e) { 336 var $this = $(this).addClass('on'), 337 iCateNo = Number(methods.getParam($this.find('a').attr('href'), 'cate_no')); 338 339 if (!iCateNo) { 340 iCateNo = Number(methods.getParamSeo($this.find('a').attr('href'))); 341 } 342 343 if (!iCateNo) { 344 return; 345 } 346 if ($(this).find('.sub-category').length < 1) { 347 methods.show($this, iCateNo); 348 } 349 }); 350 351 352}); 353function depthThree(target, cateNo) { 354 var $cate = ''; 355 $.ajax({ 356 url: '/exec/front/Product/SubCategory', 357 dataType: 'json', 358 success: function (data) { 359 $.each(data, function (m, key) { 360 if (key.parent_cate_no == cateNo) { 361 $cate += '<li class="sub-category__item"><a class="sub-category__link jsChildThree" href="/product/list.html' + key.param + '">' + key.name + '</a></li>'; 362 }; 363 }); 364 365 if (target.next().length < 1 && $cate != '') { 366 target.each(function () { 367 $(this).after('<div class="sub-category sub-category--depth-three"><ul class="sub-category__list sub-category__list">' + $cate + '</ul></div>'); 368 }); 369 target.next('.sub-category').addClass('on'); 370 setTimeout(function () { 371 target.next('.sub-category').removeClass('on'); 372 }, 100); 373 } 374 } 375 }); 376} 377 378$(function () { 379 380 $(document).on('mouseenter', '.jsChildTwo', function () { 381 var getCateNo = $(this).attr('href').split('/')[3]; 382 depthThree($(this), getCateNo); 383 }); 384 385 $(document).on('mouseenter', '.jsChildThree', function () { 386 var getCateNo = $(this).attr('href').split('cate_no=')[1]; 387 depthThree($(this), getCateNo); 388 }); 389 390}); 391var isInIFrame = (window.location != window.parent.location); 392 393if(document.getElementById('chkMoa')) { 394 var sampleChk = document.getElementById('chkMoa').dataset.chk; 395} 396 397if(document.getElementById('login-popup-sample')) var sampleName = document.getElementById('login-popup-sample'); 398var header = $('.jsHeader'); 399var todayBtn = document.querySelector('.jsTodayBtn'); 400var closeBtn = document.querySelector('.jsTodayClose'); 401var todayPopup = document.querySelector('.today-view'); 402var todayBG = document.querySelector('.jsTodayBG'); 403 404if(document.getElementById('login-popup-sample')) { 405 if (sampleName.innerHTML == '모ìì¤íëì¤' || sampleName.innerHTML == 'moa' || sampleName.innerHTML == '모ì' || sampleName.innerHTML == 'moa-studio') { 406 407 if(document.querySelectorAll('.fakeSnsLoginPop').length > 0) { 408 var fakeLogin = document.querySelectorAll('.fakeSnsLoginPop'); 409 fakeLogin[0].classList.remove('displaynone'); 410 fakeLogin[1].classList.remove('displaynone'); 411 } 412 window.addEventListener('resize', function() { 413 var resizeFlag = sessionStorage.getItem('reload'); 414 if(isInIFrame==true) { 415 if(document.body.clientWidth <= 768 && !resizeFlag) { 416 sessionStorage.setItem('reload', true); 417 location.reload(); 418 } 419 if(document.body.clientWidth > 768 && resizeFlag) { 420 sessionStorage.removeItem('reload'); 421 } 422 } 423 }); 424 425 } 426} 427 428// IE Check 429function checkIE() { 430 var agent = navigator.userAgent.toLowerCase(); 431 if ((navigator.appName == 'Netscape' && agent.indexOf('trident') != -1) || (agent.indexOf("msie") != -1)) { 432 $('.jsIEPopup').addClass('on'); 433 $('.jsIEPopupClose').on('click', function () { 434 window.close(); 435 }); 436 } 437} 438 439if(document.getElementById('chkMoa')) { 440 if (sampleChk == '9999') { 441 window.addEventListener('resize', function() { 442 var resizeFlag = sessionStorage.getItem('reload'); 443 if(isInIFrame==true) { 444 if(document.body.clientWidth <= 768 && !resizeFlag) { 445 sessionStorage.setItem('reload', true); 446 location.reload(); 447 } 448 if(document.body.clientWidth > 768 && resizeFlag) { 449 sessionStorage.removeItem('reload'); 450 } 451 } 452 console.log(isInIFrame); 453 }); 454 $('.sub-category__list--global .sub-category__item').last().find('a').attr('href', 'http://skin-skin14--shop3.ecudemo215459.cafe24.com/'); 455 $('.aside-global__item').last().find('a').attr('href', 'http://skin-skin14--shop3.ecudemo215459.cafe24.com/'); 456 } 457} 458 459// Run load Effect 460function loadEft() { 461 $('html').addClass('loaded'); 462} 463 464// Top banner setting 465function runTopbanner() { 466 467 var closeChk = sessionStorage.getItem('bannerClose'); 468 469 if (!closeChk) { 470 $('.jsTopBanner').addClass('on'); 471 } 472 473 $('.jsTopBannerClose').on('click', function () { 474 $('.jsTopBanner').slideUp(); 475 sessionStorage.setItem('bannerClose', true); 476 }); 477} 478 479// Scroll header fixed 480function scrollHeaderFixed() { 481 var getScroll = $(window).scrollTop(); 482 if ($('.jsTopBanner').length > 0 || $('.jsTopBanner').css('display') != 'none') { 483 var loss = $('.jsTopBanner').outerHeight(); 484 } 485 if ($('.jsTopBanner').length < 1 || $('.jsTopBanner').css('display') == 'none') { 486 var loss = 0; 487 } 488 if (getScroll >= loss) { 489 $('.jsHeader').addClass('fixed'); 490 $('.jsScrollUp').addClass('on'); 491 } 492 if (getScroll < loss) { 493 $('.jsHeader').removeClass('fixed'); 494 $('.jsScrollUp').removeClass('on'); 495 } 496} 497 498function handleSearchOn() { 499 $('.jsHeader').addClass('search-on'); 500 $('.search').addClass('on'); 501 $('.search #keyword').focus(); 502} 503 504function handleSearchOff() { 505 $('.jsHeader').removeClass('search-on'); 506 $('.search').removeClass('on'); 507} 508 509function handleCartClose() { 510 var cartData = $('#cart-data'); 511 cartData.removeClass('on'); 512 setTimeout(function() { 513 cartData.remove(); 514 $('#cart-script').remove(); 515 },700); 516} 517 518function handleCartOpen(e) { 519 $.ajax({ 520 url: '/moa/import/popup/cart_data.html', 521 dataType: 'html', 522 success: function (result) { 523 $('body').append(result); 524 $('#cart-data').addClass('on'); 525 }, 526 complete: function() { 527 $('.cart-loading').addClass('stop'); 528 $('.jsCartClose, .cart-data-bg').on('click', handleCartClose); 529 } 530 }); 531 e.preventDefault(); 532} 533 534function policyDropdown() { 535 if ($(window).width() > 1023) { 536 // Footer menu hover
537 $('.jsPolicy').hover(function () { 538 $(this).children('.policy__list').stop(true, true).slideDown(); 539 }, function () { 540 $(this).children('.policy__list').stop(true, true).slideUp(); 541 }); 542 } else { 543 $('.jsPolicy').on('click', function () { 544 $(this).toggleClass('on').children('.policy__list').slideToggle(); 545 }); 546 } 547} 548 549function pageScrollUp() { 550 $('html, body').animate({ 551 scrollTop: 0 552 }, 400); 553} 554 555function handleLoginPopupOn(e) { 556 $('.jsLoginPopup, .jsLoginPopupBG').fadeIn(300).addClass('on'); 557 e.preventDefault(); 558} 559 560function handleLoginPopupOff() { 561 $('.jsLoginPopup, .jsLoginPopupBG').fadeOut(300).removeClass('on'); 562} 563 564$(function () { 565 566 loadEft(); 567 runTopbanner(); 568 policyDropdown(); 569 $(window).on('load scroll', scrollHeaderFixed); 570 $('.jsSearchOpen').on('click', handleSearchOn); 571 $('.jsSearchClose, .search-bg').on('click', handleSearchOff); 572 $('.jsScrollUp').on('click', pageScrollUp); 573 $('.jsLoginPopBtn').on('click', handleLoginPopupOn); 574 $('.icon-menu__item--cart').on('click', handleCartOpen); 575 $('.jsSampleBtnLoginPopup').on('click', function (e) { 576 alert('ê´ë¦¬ì ì¤ì ì íµí´ ê°í¸ ë¡ê·¸ì¸ ì¬ì©ì´ ê°ë¥í©ëë¤.'); 577 e.preventDefault(); 578 }); 579 $('.jsLoginPopupClose').on('click', handleLoginPopupOff); 580 $(document).on('click', function(e) { 581 if (!$(e.target).is('.jsLoginPopBtn, .jsLoginPopBtn *, #type-popup, #type-popup *')) { 582 handleLoginPopupOff(); 583 } 584 }); 585 checkIE(); 586}); 587var aCategory = []; 588$(document).ready(function(){ 589 var methods = { 590 aCategory : [], 591 aSubCategory : {}, 592 get: function() { 593 $.ajax({ 594 url : '/exec/front/Product/SubCategory', 595 dataType: 'json', 596 success: function(aData) { 597 if (aData == null || aData == 'undefined') { 598 methods.checkSub(); 599 return; 600 } 601 for (var i=0; i<aData.length; i++) 602 { 603 var sParentCateNo = aData[i].parent_cate_no; 604 var sCateNo = aData[i].cate_no; 605 if (!methods.aSubCategory[sParentCateNo]) { 606 methods.aSubCategory[sParentCateNo] = []; 607 } 608 if (!aCategory[sCateNo]) { 609 aCategory[sCateNo] = []; 610 } 611 methods.aSubCategory[sParentCateNo].push( aData[i] ); 612 aCategory[sCateNo] = aData[i]; 613 614 } 615 methods.checkSub(); 616// 617 $.each(aData, function(idx, item) { 618 if(item.design_page_url != "product/list.html") { 619 $('#cate'+item.cate_no).find('.view').attr('href', '/'+item.design_page_url+item.param); 620 } 621 }); 622 623 624 } 625 }); 626 }, 627 getParam: function(sUrl, sKey) { 628 if (typeof sUrl !== 'string') return; 629 var aUrl = sUrl.split('?'); 630 var sQueryString = aUrl[1]; 631 var aParam = {}; 632 if (sQueryString) { 633 var aFields = sQueryString.split("&"); 634 var aField = []; 635 for (var i=0; i<aFields.length; i++) { 636 aField = aFields[i].split('='); 637 aParam[aField[0]] = aField[1]; 638 } 639 } 640 return sKey ? aParam[sKey] : aParam; 641 }, 642 643 show: function(overNode, iCateNo) { 644 var oParentNode = overNode; 645 var aHtml = []; 646 var sMyCateList = localStorage.getItem("myCateList"); 647 if (methods.aSubCategory[iCateNo] != undefined) { 648 aHtml.push('<ul class="aside-child">'); 649 $(methods.aSubCategory[iCateNo]).each(function() { 650 var sNextParentNo = this.cate_no; 651 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 652 if (methods.aSubCategory[sNextParentNo] == undefined) { 653 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 654 var sHref = '/'+this.design_page_url+this.param; 655 } else { 656 aHtml.push('<li id="cate'+this.cate_no+'">'); 657 var sHref = '#none'; 658 } 659 aHtml.push('<a href="/'+this.design_page_url+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 660 if (methods.aSubCategory[sNextParentNo] != undefined) aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate"><svg xmlns="http://www.w3.org/2000/svg" width="11.001" height="6.208" viewBox="0 0 11.001 6.208">
660<path id="chevron-down" d="M7.646,14.646a.5.5,0,0,0,.708.708ZM13,10l.354.354L13.707,10l-.353-.354ZM8.354,4.646a.5.5,0,0,0-.708.708Zm0,10.708,5-5-.708-.708-5,5Zm5-5.708-5-5-.708.708,5,5Z" transform="translate(15.501 -7.499) rotate(90)"></path></svg></a>'); 661 662 if (methods.aSubCategory[sNextParentNo] != undefined) { 663 aHtml.push('<ul class="aside-child-third">'); 664 $(methods.aSubCategory[sNextParentNo]).each(function() { 665 var sNextParentNo2 = this.cate_no; 666 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 667 if (methods.aSubCategory[sNextParentNo2] == undefined) { 668 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 669 var sHref = '/'+this.design_page_url+this.param; 670 } else { 671 aHtml.push('<li id="cate'+this.cate_no+'">'); 672 var sHref = '#none'; 673 } 674 aHtml.push('<a href="/'+this.design_page_url+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 675 if (methods.aSubCategory[sNextParentNo] != undefined) aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate"><svg xmlns="http://www.w3.org/2000/svg" width="11.001" height="6.208" viewBox="0 0 11.001 6.208"><path id="chevron-down" d="M7.646,14.646a.5.5,0,0,0,.708.708ZM13,10l.354.354L13.707,10l-.353-.354ZM8.354,4.646a.5.5,0,0,0-.708.708Zm0,10.708,5-5-.708-.708-5,5Zm5-5.708-5-5-.708.708,5,5Z" transform="translate(15.501 -7.499) rotate(90)"></path></svg></a>'); 676 677 if (methods.aSubCategory[sNextParentNo2] != undefined) { 678 aHtml.push('<ul>'); 679 680 $(methods.aSubCategory[sNextParentNo2]).each(function() { 681 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 682 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 683 aHtml.push('<a href="/'+this.design_page_url+this.param+'" class="view" cate="'+this.param+'" onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 684 aHtml.push('</li>'); 685 }); 686 aHtml.push('</ul>'); 687 } 688 aHtml.push('</li>'); 689 }); 690 aHtml.push('</ul>'); 691 } 692 aHtml.push('</li>'); 693 }); 694 aHtml.push('</ul>'); 695 } 696 if($(oParentNode).children('ul').length < 1) { 697 $(oParentNode).append(aHtml.join('')); 698 } 699 if (window.i18nextCafe24) { 700 i18nextCafe24.translate('data-i18n-new'); 701 } 702 }, 703 close: function() { 704// $('.aside-child').remove(); 705 }, 706 checkSub: function() { 707 $('.cate').each(function(){ 708 var sParam = $(this).attr('cate'); 709 if (!sParam) return; 710 var iCateNo = Number(methods.getParam(sParam, 'cate_no')); 711 var result = methods.aSubCategory[iCateNo]; 712 if (result == undefined) { 713 if ($(this).closest('#slideProjectList').length) { 714 var sHref = '/product/project.html'+sParam; 715 } else { 716 var sHref = '/product/list.html'+sParam; 717 } 718 719 $(this).attr('href', sHref); 720 $(this).parent().attr('class', 'noChild aside-category__item'); 721 } 722 }); 723 } 724 }; 725 726 methods.get(); 727 728 function asideOn() { 729 $('.aside').addClass('on'); 730 } 731 732 function asideOff() { 733 $('.aside').removeClass('on'); 734 setTimeout(function() { 735 $('.aside a.cate').removeClass('on');
736 $('.aside-child, .aside-child-third').slideUp(); 737 },600); 738 } 739 740 $('.jsHamburger').on('click', asideOn); 741 $('.aside-bg').on('click', asideOff); 742 743 $(document).on('click', '#slideCateList > ul > li > a.cate', function(e) { 744 var sParam = $(this).attr('cate'); 745// if (!sParam) return; 746 var iCateNo = Number(methods.getParam(sParam, 'cate_no')); 747 var hasClass = $(this).parent().hasClass('selected'); 748 749 //if ($(this).parent().attr('class') == 'xans-record- selected') { 750 if(sParam) { 751 if (!iCateNo) return; 752 $('#aside #slideCateList li').removeClass('selected'); 753 methods.close(); 754 methods.show(this.parentNode, iCateNo); 755 } 756 if(!$(this).hasClass('on')) { 757 $('#slideCateList > ul > li > a.cate').removeClass('on'); 758 $(this).addClass('on'); 759 $('.aside-child').slideUp(); 760 $(this).next('.aside-child').slideDown(); 761 } else { 762 $('#slideCateList > ul > li > a.cate').removeClass('on'); 763 $('.aside-child').slideUp(); 764 } 765 e.preventDefault(); 766 }); 767 768 $(document).on('click', '.aside-child > li > a.cate', function(e) { 769 if(!$(this).hasClass('on')) { 770 $('.aside-child > li > a.cate').removeClass('on'); 771 $(this).addClass('on'); 772 $('.aside-child-third').slideUp(); 773 $(this).next('.aside-child-third').slideDown(); 774 } else { 775 $('.aside-child > li > a.cate').removeClass('on'); 776 $('.aside-child-third').slideUp(); 777 } 778 e.preventDefault(); 779 }) 780 781 $('#aside ul a.cate').click(function(e){ 782 $(this).parent().find('li').removeClass('selected'); 783 $(this).parent().toggleClass('selected'); 784 if (!$(this).parent('li').hasClass('noChild')){ 785 e.preventDefault(); 786 } 787 }); 788 789 $('#slideCateList h2').click(function() { 790 var oParentId = $(this).parent().attr('id'); 791 if (oParentId == 'slideCateList' || oParentId == 'slideMultishopList' || oParentId == 'slideProjectList') { 792 ($(this).attr('class') == 'selected') ? $(this).next().hide() : $(this).next().show(); 793 } 794 $(this).toggleClass('selected'); 795 }); 796 797 $('#slideProjectList .icoCategory').click(function() { 798 var target = $(this).parents('#slideProjectList'); 799 if(target.find('.categoryList').css("display") == "none"){ 800 target.find('.categoryList').show(); 801 }else{ 802 target.find('.categoryList').hide(); 803 } 804 805 $(this).parents('.title').toggleClass('selected'); 806 }); 807 808// $(document).on('click', '.aside-category__link', function(e) { 809// if($(this).next('.cate').length > 0) { 810// $(this).next('.cate').trigger('click'); 811// e.preventDefault(); 812// } 813// }); 814 815}); 816function subMenuEvent(obj) { 817 $(obj).parent().find('li').removeClass('selected'); 818 $(obj).parent().toggleClass('selected'); 819} 820 821function checkInArray(sBookmarkList, iCateNo) { 822 if (sBookmarkList == null) return false; 823 var aBookmarkList = sBookmarkList.split("|"); 824 for (var i = 0; i < aBookmarkList.length; i++) { 825 if (aBookmarkList[i] == iCateNo) { 826 return true; 827 } 828 } 829 return false; 830} 831$(document).ready(function(){ 832 if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") { 833 var sShippingCountryCode4Cookie = 'shippingCountryCode'; 834 var bShippingCountryProc = false; 835 836 // ë°°ì¡êµê° ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 837 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) { 838 $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide(); 839 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide(); 840 } else { 841 $('.thumb .xans-layout-multishoplistitem').hide(); 842 var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)'); 843 if (typeof(aShippingCountryCode) != 'undefined' && aS
843hippingCountryCode != null && aShippingCountryCode.length > 2) { 844 var sShippingCountryValue = aShippingCountryCode[2]; 845 } 846 847 // query stringì¼ë¡ ëì´ ì¨ ë°°ì¡êµê° ê°ì´ ìë¤ë©´, ê·¸ ê°ì ì ì©í¨ 848 var aHrefCountryValue = decodeURIComponent(location.href).split("/?country="); 849 850 if (aHrefCountryValue.length == 2) { 851 var sShippingCountryValue = aHrefCountryValue[1]; 852 } 853 854 // ë©ì¸ íì´ì§ìì êµê°ì íì ìí ê²½ì°, ê·¸ ì¸ì íì´ì§ìì ì í ë ê°ì´ ì ëì¤ë íì ì²ë¦¬ 855 if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) { 856 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 857 858 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 859 $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 860 } 861 } 862 if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) { 863 sShippingCountryValue = sShippingCountryValue.split("#")[0]; 864 var bShippingCountryProc = true; 865 866 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 867 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 868 var expires = new Date(); 869 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 870 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 871 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 872 $("#f_country").val(sShippingCountryValue).change();; 873 } 874 } 875 } 876 // ì¸ì´ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 877 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) { 878 $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide(); 879 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide(); 880 } else { 881 $('.thumb .xans-layout-multishoplistitem').hide(); 882 } 883 884 // ë°°ì¡êµê° ë° ì¸ì´ ì¤ì ì´ ë ë¤ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 885 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) { 886 $(".xans-layout-multishopshipping").hide(); 887 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide(); 888 } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // ë°°ì¡êµê° ê°ì ì²ë¦¬í ì ì´ ìê³ , ë©ì¸íë©´ì¼ ëë§ ì í ë ì´ì´ë¥¼ ëì 889 var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(); 890 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 891 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 892 // ë°°ì¡êµê° ì íì ì¬ì©í´ì¼ ë ì´ì´ë¥¼ ë³´ì´ê² í¨ 893 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) { 894 $(".xans-layout-multishopshipping").show(); 895 } 896 } 897 898 $(".xans-layout-multishopshipping .btnClose").bind("click", function() { 899 $(".xans-layout-multishopshipping").hide(); 900 }); 901 902 $(".xans-layout-multishopshipping .ec-base-button a").bind("click", function() { 903 var expires = new Date(); 904 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 905 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 906 907 // ëë©ì¸ 문ì ë¡ ì¿ í¤ë¡ ë°°ì¡êµê° ì¤ì ì´ ì ëë ê²½ì°ë¥¼ ìí´ query stringì¼ë¡ ë°°ì¡êµê° ê°
907ì ëê¹ 908 var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 909 910 location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting; 911 }); 912 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").bind("click", function() { 913 $(".xans-layout-multishopshipping").show(); 914 }); 915 } 916});
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.