1/** 2 * ì¹´í ê³ ë¦¬ ë§ì°ì¤ ì¤ë² ì´ë¯¸ì§ 3 * ì¹´í ê³ ë¦¬ ë,ì¤,ì,íìë¶ë¥ê¹ì§ ì¶ë ¥ - ì¸ë¡í 4 * 210827 ìì í ìì 5 */ 6 7$(document).ready(function(){ 8 9 var methods = { 10 aCategory : [], 11 aSubCategory : {}, 12 13 get: function() 14 { 15 $.ajax({ 16 url : '/exec/front/Product/SubCategory', 17 dataType: 'json', 18 success: function(aData) { 19 20 if (aData == null || aData == 'undefined') return; 21 for (var i=0; i<aData.length; i++) 22 { 23 var sParentCateNo = aData[i].parent_cate_no; 24 25 if (!methods.aSubCategory[sParentCateNo]) { 26 methods.aSubCategory[sParentCateNo] = []; 27 } 28 29 methods.aSubCategory[sParentCateNo].push( aData[i] ); 30 } 31 } 32 }); 33 }, 34 35 getParam: function(sUrl, sKey) { 36 37 var aUrl = sUrl.split('?'); 38 var sQueryString = aUrl[1]; 39 var aParam = {}; 40 41 if (sQueryString) { 42 var aFields = sQueryString.split("&"); 43 var aField = []; 44 for (var i=0; i<aFields.length; i++) { 45 aField = aFields[i].split('='); 46 aParam[aField[0]] = aField[1]; 47 } 48 } 49 return sKey ? aParam[sKey] : aParam; 50 }, 51 52 getParamSeo: function(sUrl) { 53 var aUrl = EC_ROUTE.getCleanUrl(sUrl).split('/'); 54 return aUrl[3] ? aUrl[3] : null; 55 }, 56 57 show: function(overNode, iCateNo) { 58 var oParentNode = overNode; 59 var aHtml = []; 60 var sMyCateList = localStorage.getItem("myCateList"); 61 if (methods.aSubCategory[iCateNo] != undefined) { 62 aHtml.push('<ul class="sub-category">'); 63 $(methods.aSubCategory[iCateNo]).each(function() { 64 var sNextParentNo = this.cate_no; 65 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 66 if (methods.aSubCategory[sNextParentNo] == undefined) { 67 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 68 var sHref = '/product/list.html'+this.param; 69 } else { 70 aHtml.push('<li id="cate'+this.cate_no+'">'); 71 var sHref = '#none'; 72 } 73 aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" onmouseover="subMenuon(this);" data-i18n-new>'+this.name+'</a>'); 74 75 if (methods.aSubCategory[sNextParentNo] != undefined) { 76 aHtml.push('<ul class="sub-category-middle">'); 77 $(methods.aSubCategory[sNextParentNo]).each(function() { 78 var sNextParentNo2 = this.cate_no; 79 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 80 if (methods.aSubCategory[sNextParentNo2] == undefined) { 81 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 82 var sHref = '/product/list.html'+this.param; 83 } else { 84 aHtml.push('<li id="cate'+this.cate_no+'">'); 85 var sHref = '#none'; 86 } 87 aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" onmouseover="subMenuon(this);" data-i18n-new>'+this.name+'</a>'); 88 89 if (methods.aSubCategory[sNextParentNo2] != undefined) { 90 aHtml.push('<ul class="sub-category-child">'); 91 92 $(methods.aSubCategory[sNextParentNo2]).each(function() { 93 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 94 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 95 aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" onmouseover="subMenuon(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 96 aHtml.push('</li>'); 97 }); 98 aHtml.push('</ul>'); 99 } 100 101 aHtml.push('</li>'); 102 }); 103 aHtml.push('</ul>'); 104 } 105 aHtml.push('</li>'); 106 }); 107 aHtml.push('</ul>'); 108 } 109 $(oParentNode).append(aHtml.join('')); 110 if (window.i18nextCafe24) { 111 i18nextCafe24.translate('data-i18n-new'); 112 } 113 }, 114 115 close: function() { 116 $('.sub-category').remove(); 117 } 118 }; 119 120 methods.get(); 121 122 $('#header .xans-layout-category li').mouseenter(function(e) { 123 var $this = $(this).addClass('on'), 124 iCateNo = Number(methods.getParam($this.find('a').attr('href'), 'cate_no')); 125 126 if (!iCateNo) { 127 iCateNo = Number(methods.getParamSeo($this.find('a').attr('href'))); 128 } 129 130 if (!iCateNo) { 131 return; 132 } 133 134 methods.show($this, iCateNo); 135 }).mouseleave(function(e) { 136 $(this).removeClass('on'); 137 138 methods.close(); 139 }); 140}); 141 142function subMenuon(obj) { 143 $(obj).parent().find('li').removeClass('on'); 144 $(obj).parent().addClass('on'); 145 $(obj).parent().siblings().removeClass("on"); 146} 147var aCategory = []; 148$(function(){ 149 var methods = { 150 aCategory : [], 151 aSubCategory : {}, 152 get: function() { 153 $.ajax({ 154 url : '/exec/front/Product/SubCategory', 155 dataType: 'json', 156 success: function(aData) { 157 if (aData == null || aData == 'undefined') { 158 methods.checkSub(); 159 return; 160 } 161 for (var i=0; i<aData.length; i++) 162 { 163 var sParentCateNo = aData[i].parent_cate_no; 164 var sCateNo = aData[i].cate_no; 165 if (!methods.aSubCategory[sParentCateNo]) { 166 methods.aSubCategory[sParentCateNo] = []; 167 } 168 if (!aCategory[sCateNo]) { 169 aCategory[sCateNo] = []; 170 } 171 methods.aSubCategory[sParentCateNo].push( aData[i] ); 172 aCategory[sCateNo] = aData[i]; 173 } 174 methods.checkSub(); 175 } 176 }); 177 }, 178 getParam: function(sUrl, sKey) { 179 if (typeof sUrl !== 'string') return; 180 var aUrl = sUrl.split('?'); 181 var sQueryString = aUrl[1]; 182 var aParam = {};
183 if (sQueryString) { 184 var aFields = sQueryString.split("&"); 185 var aField = []; 186 for (var i=0; i<aFields.length; i++) { 187 aField = aFields[i].split('='); 188 aParam[aField[0]] = aField[1]; 189 } 190 } 191 return sKey ? aParam[sKey] : aParam; 192 }, 193 194 show: function(overNode, iCateNo) { 195 var oParentNode = overNode; 196 var aHtml = []; 197 var sMyCateList = localStorage.getItem("myCateList"); 198 if (methods.aSubCategory[iCateNo] != undefined) { 199 aHtml.push('<ul class="slideSubMenu">'); 200 $(methods.aSubCategory[iCateNo]).each(function() { 201 var sNextParentNo = this.cate_no; 202 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 203 if (methods.aSubCategory[sNextParentNo] == undefined) { 204 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 205 var sHref = '/product/list.html'+this.param; 206 } else { 207 aHtml.push('<li id="cate'+this.cate_no+'">'); 208 var sHref = '#none'; 209 } 210 aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 211 if (methods.aSubCategory[sNextParentNo] != undefined) aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate">ìí보기</a>'); 212 213 if (methods.aSubCategory[sNextParentNo] != undefined) { 214 aHtml.push('<ul>'); 215 $(methods.aSubCategory[sNextParentNo]).each(function() { 216 var sNextParentNo2 = this.cate_no; 217 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 218 if (methods.aSubCategory[sNextParentNo2] == undefined) { 219 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 220 var sHref = '/product/list.html'+this.param; 221 } else { 222 aHtml.push('<li id="cate'+this.cate_no+'">'); 223 var sHref = '#none'; 224 } 225 aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>'); 226 if (methods.aSubCategory[sNextParentNo] != undefined) aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate">ìí보기</a>'); 227 228 if (methods.aSubCategory[sNextParentNo2] != undefined) { 229 aHtml.push('<ul>'); 230 231 $(methods.aSubCategory[sNextParentNo2]).each(function() { 232 aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">'); 233 var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : ''; 234 aHtml.push('<a href="/product/list.html'+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>'); 235 aHtml.push('</li>'); 236 }); 237 aHtml.push('</ul>'); 238 } 239 aHtml.push('</li>'); 240 }); 241 aHtml.push('</ul>'); 242 } 243 aHtml.push('</li>'); 244 }); 245 aHtml.push('</ul>'); 246 } 247 $(oParentNode).append(aHtml.join('')); 248 if (window.i18nextCafe24) { 249 i18nextCafe24.translate('data-i18n-new'); 250 } 251 }, 252 close: function() { 253 $('.slideSubMenu').remove(); 254 }, 255 checkSub: function() { 256 $('.cate').each(function(){ 257 var sParam = $(this).attr('cate'); 258 if (!sParam) return; 259 var iCateNo = Number(methods.getParam(sParam, 'cate_no')); 260 var result = methods.aSubCategory[iCateNo]; 261 if (result == undefined) { 262 if ($(this).closest('#slideProjectList').length) { 263 var sHref = '/product/project.html'+sParam; 264 } else { 265 var sHref = '/product/list.html'+sParam; 266 } 267 268 $(this).attr('href', sHref); 269 $(this).parent().attr('class', 'noChild'); 270 } 271 }); 272 } 273 }; 274 275 methods.get(); 276 277 $('#slideCateList li > a.cate').on('click', function(e) { 278 var sParam = $(this).attr('cate'); 279 if (!sParam) return; 280 var iCateNo = Number(methods.getParam(sParam, 'cate_no')); 281 var hasClass = $(this).parent().hasClass('selected'); 282 283 //if ($(this).parent().attr('class') == 'xans-record- selected') { 284 if(hasClass) { 285 methods.close(); 286 } else { 287 if (!iCateNo) return; 288 $('#aside #slideCateList li').removeClass('selected'); 289 methods.close(); 290 methods.show(this.parentNode, iCateNo); 291 } 292 }); 293 294 /* 모ë°ì¼ ì¬ë¼ì´ëë° ì¹´í ê³ ë¦¬ ì¤ë¶ë¥ì²´í¬ */ 295 jQuery('#slide_add_category li').each(function(){ 296 if( jQuery(this).children('ul').length == 0 ){ 297 jQuery(this).addClass('noChild'); 298 } else { 299 jQuery(this).append('<a href="#none" class="cate">ìí보기</a>'); 300 } 301 }); 302 303 /* 모ë°ì¼ ì¬ë¼ì´ëë° ì¹´í ê³ ë¦¬ */ 304 $('#aside ul a.cate').on('click', function(e){ 305 $(this).parent().find('li').removeClass('selected'); 306 $('#slideCateList .categoryList li').removeClass('selected'); 307 $(this).parent().toggleClass('selected'); 308 if (!$(this).parent('li').hasClass('noChild')){ 309 e.preventDefault(); 310 } 311 }); 312 313 /* ì¬ë¼ì´ë ê³ ê°ì¼í° í ê¸ */ 314 jQuery('#aside .navigation-menu__board .icoCategory').click(function() { 315 var target = jQuery(this).parents('#aside .navigation-menu__board'); 316 if(target.find('.categoryList').css("display") == "none"){ 317 target.find('.categoryList').show(); 318 }else{ 319 target.find('.categoryList').hide(); 320 } 321 322 jQuery(this).parents('.title').toggleClass('selected'); 323 }); 324 325 $('#slideCateList h2').on('click', function() { 326 var oParentId = $(this).parent().attr('id'); 327 if (oParentId == 'slideCateList' || oParentId == 'slideMultishopList' || oParentId == 'slideProjectList') { 328 ($(this).attr('class') == 'selected') ? $(this).next().hide() : $(this).next().show(); 329 } 330 $(this).toggleClass('selected'); 331 }); 332
333 $('#slideProjectList .icoCategory').on('click', function() { 334 var target = $(this).parents('#slideProjectList'); 335 if(target.find('.categoryList').css("display") == "none"){ 336 target.find('.categoryList').show(); 337 }else{ 338 target.find('.categoryList').hide(); 339 } 340 341 $(this).parents('.title').toggleClass('selected'); 342 }); 343 344}); 345function subMenuEvent(obj) { 346 $(obj).parent().find('li').removeClass('selected'); 347 $(obj).parent().toggleClass('selected'); 348} 349 350function checkInArray(sBookmarkList, iCateNo) { 351 if (sBookmarkList == null) return false; 352 var aBookmarkList = sBookmarkList.split("|"); 353 for (var i = 0; i < aBookmarkList.length; i++) { 354 if (aBookmarkList[i] == iCateNo) { 355 return true; 356 } 357 } 358 return false; 359} 360/* 361 _ _ _ _ 362 ___| (_) ___| | __ (_)___ 363/ __| | |/ __| |/ / | / __| 364\__ \ | | (__| < _ | \__ \ 365|___/_|_|\___|_|\_(_)/ |___/ 366 |__/ 367 368 Version: 1.8.0 369 Author: Ken Wheeler 370 Website: http://kenwheeler.github.io 371 Docs: http://kenwheeler.github.io/slick 372 Repo: http://github.com/kenwheeler/slick 373 Issues: http://github.com/kenwheeler/slick/issues 374 375 */ 376/* global window, document, define, jQuery, setInterval, clearInterval */ 377(function(factory) { 378 'use strict'; 379 if (typeof define === 'function' && define.amd) { 380 define(['jquery'], factory); 381 } else if (typeof exports !== 'undefined') { 382 module.exports = factory(require('jquery')); 383 } else { 384 factory(jQuery); 385 } 386 387}(function($) { 388 'use strict'; 389 var Slick = window.Slick || {}; 390 391 Slick = (function() { 392 393 var instanceUid = 0; 394 395 function Slick(element, settings) { 396 397 var _ = this, dataSettings; 398 399 _.defaults = { 400 accessibility: true, 401 adaptiveHeight: false, 402 appendArrows: $(element), 403 appendDots: $(element), 404 arrows: true, 405 asNavFor: null, 406 prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>', 407 nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>', 408 autoplay: false, 409 autoplaySpeed: 3000, 410 centerMode: false, 411 centerPadding: '50px', 412 cssEase: 'ease', 413 customPaging: function(slider, i) { 414 return $('<button type="button" data-role="none" role="button" tabindex="0" />').text(i + 1); 415 }, 416 dots: false, 417 dotsClass: 'slick-dots', 418 draggable: true, 419 easing: 'linear', 420 edgeFriction: 0.35, 421 fade: false, 422 focusOnSelect: false, 423 infinite: true, 424 initialSlide: 0, 425 lazyLoad: 'ondemand', 426 mobileFirst: false, 427 pauseOnHover: true, 428 pauseOnFocus: true, 429 pauseOnDotsHover: false, 430 respondTo: 'window', 431 responsive: null, 432 rows: 1, 433 rtl: false, 434 slide: '', 435 slidesPerRow: 1, 436 slidesToShow: 1, 437 slidesToScroll: 1, 438 speed: 500, 439 swipe: true, 440 swipeToSlide: false, 441 touchMove: true, 442 touchThreshold: 5, 443 useCSS: true, 444 useTransform: true, 445 variableWidth: false, 446 vertical: false, 447 verticalSwiping: false, 448 waitForAnimate: true, 449 zIndex: 1000 450 }; 451 452 _.initials = { 453 animating: false, 454 dragging: false, 455 autoPlayTimer: null, 456 currentDirection: 0, 457 currentLeft: null, 458 currentSlide: 0, 459 direction: 1, 460 $dots: null, 461 listWidth: null, 462 listHeight: null, 463 loadIndex: 0, 464 $nextArrow: null, 465 $prevArrow: null, 466 slideCount: null, 467 slideWidth: null, 468 $slideTrack: null, 469 $slides: null, 470 sliding: false, 471 slideOffset: 0, 472 swipeLeft: null
vendor: 11,177 bytes, lines 472-855
472, 473 $list: null, 474 touchObject: {}, 475 transformsEnabled: false, 476 unslicked: false 477 }; 478 479 $.extend(_, _.initials); 480 481 _.activeBreakpoint = null; 482 _.animType = null; 483 _.animProp = null; 484 _.breakpoints = []; 485 _.breakpointSettings = []; 486 _.cssTransitions = false; 487 _.focussed = false; 488 _.interrupted = false; 489 _.hidden = 'hidden'; 490 _.paused = true; 491 _.positionProp = null; 492 _.respondTo = null; 493 _.rowCount = 1; 494 _.shouldClick = true; 495 _.$slider = $(element); 496 _.$slidesCache = null; 497 _.transformType = null; 498 _.transitionType = null; 499 _.visibilityChange = 'visibilitychange'; 500 _.windowWidth = 0; 501 _.windowTimer = null; 502 503 dataSettings = $(element).data('slick') || {}; 504 505 _.options = $.extend({}, _.defaults, settings, dataSettings); 506 507 _.currentSlide = _.options.initialSlide; 508 509 _.originalSettings = _.options; 510 511 if (typeof document.mozHidden !== 'undefined') { 512 _.hidden = 'mozHidden'; 513 _.visibilityChange = 'mozvisibilitychange'; 514 } else if (typeof document.webkitHidden !== 'undefined') { 515 _.hidden = 'webkitHidden'; 516 _.visibilityChange = 'webkitvisibilitychange'; 517 } 518 519 _.autoPlay = $.proxy(_.autoPlay, _); 520 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 521 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 522 _.changeSlide = $.proxy(_.changeSlide, _); 523 _.clickHandler = $.proxy(_.clickHandler, _); 524 _.selectHandler = $.proxy(_.selectHandler, _); 525 _.setPosition = $.proxy(_.setPosition, _); 526 _.swipeHandler = $.proxy(_.swipeHandler, _); 527 _.dragHandler = $.proxy(_.dragHandler, _); 528 _.keyHandler = $.proxy(_.keyHandler, _); 529 530 _.instanceUid = instanceUid++; 531 532 // A simple way to check for HTML strings 533 // Strict HTML recognition (must start with <) 534 // Extracted from jQuery v1.11 source 535 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 536 537 538 _.registerBreakpoints(); 539 _.init(true); 540 541 } 542 543 return Slick; 544 545 }()); 546 547 Slick.prototype.activateADA = function() { 548 var _ = this; 549 550 _.$slideTrack.find('.slick-active').attr({ 551 'aria-hidden': 'false' 552 }).find('a, input, button, select').attr({ 553 'tabindex': '0' 554 }); 555 556 }; 557 558 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 559 560 var _ = this; 561 562 if (typeof(index) === 'boolean') { 563 addBefore = index; 564 index = null; 565 } else if (index < 0 || (index >= _.slideCount)) { 566 return false; 567 } 568 569 _.unload(); 570 571 if (typeof(index) === 'number') { 572 if (index === 0 && _.$slides.length === 0) { 573 $(markup).appendTo(_.$slideTrack); 574 } else if (addBefore) { 575 $(markup).insertBefore(_.$slides.eq(index)); 576 } else { 577 $(markup).insertAfter(_.$slides.eq(index)); 578 } 579 } else { 580 if (addBefore === true) { 581 $(markup).prependTo(_.$slideTrack); 582 } else { 583 $(markup).appendTo(_.$slideTrack); 584 } 585 } 586 587 _.$slides = _.$slideTrack.children(this.options.slide); 588 589 _.$slideTrack.children(this.options.slide).detach(); 590 591 _.$slideTrack.append(_.$slides); 592 593 _.$slides.each(function(index, element) { 594 $(element).attr('data-slick-index', index); 595 }); 596 597 _.$slidesCache = _.$slides; 598 599 _.reinit(); 600 601 }; 602 603 Slick.prototype.animateHeight = function() { 604 var _ = this; 605 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 606 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 607 _.$list.animate({ 608 height: targetHeight 609 }, _.options.speed); 610 } 611 }; 612 613 Slick.prototype.animateSlide = function(targetLeft, callback) { 614 615 var animProps = {}, 616 _ = this; 617 618 _.animateHeight(); 619 620 if (_.options.rtl === true && _.options.vertical === false) { 621 targetLeft = -targetLeft; 622 } 623 if (_.transformsEnabled === false) { 624 if (_.options.vertical === false) { 625 _.$slideTrack.animate({ 626 left: targetLeft 627 }, _.options.speed, _.options.easing, callback); 628 } else { 629 _.$slideTrack.animate({ 630 top: targetLeft 631 }, _.options.speed, _.options.easing, callback); 632 } 633 634 } else { 635 636 if (_.cssTransitions === false) { 637 if (_.options.rtl === true) { 638 _.currentLeft = -(_.currentLeft); 639 } 640 $({ 641 animStart: _.currentLeft 642 }).animate({ 643 animStart: targetLeft 644 }, { 645 duration: _.options.speed, 646 easing: _.options.easing, 647 step: function(now) { 648 now = Math.ceil(now); 649 if (_.options.vertical === false) { 650 animProps[_.animType] = 'translate(' + 651 now + 'px, 0px)'; 652 _.$slideTrack.css(animProps); 653 } else { 654 animProps[_.animType] = 'translate(0px,' + 655 now + 'px)'; 656 _.$slideTrack.css(animProps); 657 } 658 }, 659 complete: function() { 660 if (callback) { 661 callback.call(); 662 } 663 } 664 }); 665 666 } else { 667 668 _.applyTransition(); 669 targetLeft = Math.ceil(targetLeft); 670 671 if (_.options.vertical === false) { 672 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 673 } else { 674 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 675 } 676 _.$slideTrack.css(animProps); 677 678 if (callback) { 679 setTimeout(function() { 680 681 _.disableTransition(); 682 683 callback.call(); 684 }, _.options.speed); 685 } 686 687 } 688 689 } 690 691 }; 692 693 Slick.prototype.getNavTarget = function() { 694 695 var _ = this, 696 asNavFor = _.options.asNavFor; 697 698 if ( asNavFor && asNavFor !== null ) { 699 asNavFor = $(asNavFor).not(_.$slider); 700 } 701 702 return asNavFor; 703 704 }; 705 706 Slick.prototype.asNavFor = function(index) { 707 708 var _ = this, 709 asNavFor = _.getNavTarget(); 710 711 if ( asNavFor !== null && typeof asNavFor === 'object' ) { 712 asNavFor.each(function() { 713 var target = $(this).slick('getSlick'); 714 if(!target.unslicked) { 715 target.slideHandler(index, true); 716 } 717 }); 718 } 719 720 }; 721 722 Slick.prototype.applyTransition = function(slide) { 723 724 var _ = this, 725 transition = {}; 726 727 if (_.options.fade === false) { 728 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 729 } else { 730 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 731 } 732 733 if (_.options.fade === false) { 734 _.$slideTrack.css(transition); 735 } else { 736 _.$slides.eq(slide).css(transition); 737 } 738 739 }; 740 741 Slick.prototype.autoPlay = function() { 742 743 var _ = this; 744 745 _.autoPlayClear(); 746 747 if ( _.slideCount > _.options.slidesToShow ) { 748 _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); 749 } 750 751 }; 752 753 Slick.prototype.autoPlayClear = function() { 754 755 var _ = this; 756 757 if (_.autoPlayTimer) { 758 clearInterval(_.autoPlayTimer); 759 } 760 761 }; 762 763 Slick.prototype.autoPlayIterator = function() { 764 765 var _ = this, 766 slideTo = _.currentSlide + _.options.slidesToScroll; 767 768 if ( !_.paused && !_.interrupted && !_.focussed ) { 769 770 if ( _.options.infinite === false ) { 771 772 if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { 773 _.direction = 0; 774 } 775 776 else if ( _.direction === 0 ) { 777 778 slideTo = _.currentSlide - _.options.slidesToScroll; 779 780 if ( _.currentSlide - 1 === 0 ) { 781 _.direction = 1; 782 } 783 784 } 785 786 } 787 788 _.slideHandler( slideTo ); 789 790 } 791 792 }; 793 794 Slick.prototype.buildArrows = function() { 795 796 var _ = this; 797 798 if (_.options.arrows === true ) { 799 800 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 801 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 802 803 if( _.slideCount > _.options.slidesToShow ) { 804 805 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 806 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 807 808 if (_.htmlExpr.test(_.options.prevArrow)) { 809 _.$prevArrow.prependTo(_.options.appendArrows); 810 } 811 812 if (_.htmlExpr.test(_.options.nextArrow)) { 813 _.$nextArrow.appendTo(_.options.appendArrows); 814 } 815 816 if (_.options.infinite !== true) { 817 _.$prevArrow 818 .addClass('slick-disabled') 819 .attr('aria-disabled', 'true'); 820 } 821 822 } else { 823 824 _.$prevArrow.add( _.$nextArrow ) 825 826 .addClass('slick-hidden') 827 .attr({ 828 'aria-disabled': 'true', 829 'tabindex': '-1' 830 }); 831 832 } 833 834 } 835 836 }; 837 838 Slick.prototype.buildDots = function() { 839 840 var _ = this, 841 i, dot; 842 843 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 844 845 _.$slider.addClass('slick-dotted'); 846 847 dot = $('<ul />').addClass(_.options.dotsClass); 848 849 for (i = 0; i <= _.getDotCount(); i += 1) { 850 dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); 851 } 852 853 _.$dots = dot.appendTo(_.options.appendDots); 854 855 _.$dots.find('li').first().addClass('slick-active')
vendor: 14,869 bytes, lines 855-1343
855.attr('aria-hidden', 'false'); 856 857 } 858 859 }; 860 861 Slick.prototype.buildOut = function() { 862 863 var _ = this; 864 865 _.$slides = 866 _.$slider 867 .children( _.options.slide + ':not(.slick-cloned)') 868 .addClass('slick-slide'); 869 870 _.slideCount = _.$slides.length; 871 872 _.$slides.each(function(index, element) { 873 $(element) 874 .attr('data-slick-index', index) 875 .data('originalStyling', $(element).attr('style') || ''); 876 }); 877 878 _.$slider.addClass('slick-slider'); 879 880 _.$slideTrack = (_.slideCount === 0) ? 881 $('<div class="slick-track"/>').appendTo(_.$slider) : 882 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 883 884 _.$list = _.$slideTrack.wrap( 885 '<div aria-live="polite" class="slick-list"/>').parent(); 886 _.$slideTrack.css('opacity', 0); 887 888 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 889 _.options.slidesToScroll = 1; 890 } 891 892 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 893 894 _.setupInfinite(); 895 896 _.buildArrows(); 897 898 _.buildDots(); 899 900 _.updateDots(); 901 902 903 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 904 905 if (_.options.draggable === true) { 906 _.$list.addClass('draggable'); 907 } 908 909 }; 910 911 Slick.prototype.buildRows = function() { 912 913 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; 914 915 newSlides = document.createDocumentFragment(); 916 originalSlides = _.$slider.children(); 917 918 if(_.options.rows > 1) { 919 920 slidesPerSection = _.options.slidesPerRow * _.options.rows; 921 numOfSlides = Math.ceil( 922 originalSlides.length / slidesPerSection 923 ); 924 925 for(a = 0; a < numOfSlides; a++){ 926 var slide = document.createElement('div'); 927 for(b = 0; b < _.options.rows; b++) { 928 var row = document.createElement('div'); 929 for(c = 0; c < _.options.slidesPerRow; c++) { 930 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 931 if (originalSlides.get(target)) { 932 row.appendChild(originalSlides.get(target)); 933 } 934 } 935 slide.appendChild(row); 936 } 937 newSlides.appendChild(slide); 938 } 939 940 _.$slider.empty().append(newSlides); 941 _.$slider.children().children().children() 942 .css({ 943 'width':(100 / _.options.slidesPerRow) + '%', 944 'display': 'inline-block' 945 }); 946 947 } 948 949 }; 950 951 Slick.prototype.checkResponsive = function(initial, forceUpdate) { 952 953 var _ = this, 954 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 955 var sliderWidth = _.$slider.width(); 956 var windowWidth = window.innerWidth || $(window).width(); 957 958 if (_.respondTo === 'window') { 959 respondToWidth = windowWidth; 960 } else if (_.respondTo === 'slider') { 961 respondToWidth = sliderWidth; 962 } else if (_.respondTo === 'min') { 963 respondToWidth = Math.min(windowWidth, sliderWidth); 964 } 965 966 if ( _.options.responsive && 967 _.options.responsive.length && 968 _.options.responsive !== null) { 969 970 targetBreakpoint = null; 971 972 for (breakpoint in _.breakpoints) { 973 if (_.breakpoints.hasOwnProperty(breakpoint)) { 974 if (_.originalSettings.mobileFirst === false) { 975 if (respondToWidth < _.breakpoints[breakpoint]) { 976 targetBreakpoint = _.breakpoints[breakpoint]; 977 } 978 } else { 979 if (respondToWidth > _.breakpoints[breakpoint]) { 980 targetBreakpoint = _.breakpoints[breakpoint]; 981 } 982 } 983 } 984 } 985 986 if (targetBreakpoint !== null) { 987 if (_.activeBreakpoint !== null) { 988 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 989 _.activeBreakpoint = 990 targetBreakpoint; 991 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 992 _.unslick(targetBreakpoint); 993 } else { 994 _.options = $.extend({}, _.originalSettings, 995 _.breakpointSettings[ 996 targetBreakpoint]); 997 if (initial === true) { 998 _.currentSlide = _.options.initialSlide; 999 } 1000 _.refresh(initial); 1001 } 1002 triggerBreakpoint = targetBreakpoint; 1003 } 1004 } else { 1005 _.activeBreakpoint = targetBreakpoint; 1006 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 1007 _.unslick(targetBreakpoint); 1008 } else { 1009 _.options = $.extend({}, _.originalSettings, 1010 _.breakpointSettings[ 1011 targetBreakpoint]); 1012 if (initial === true) { 1013 _.currentSlide = _.options.initialSlide; 1014 } 1015 _.refresh(initial); 1016 } 1017 triggerBreakpoint = targetBreakpoint; 1018 } 1019 } else { 1020 if (_.activeBreakpoint !== null) { 1021 _.activeBreakpoint = null; 1022 _.options = _.originalSettings; 1023 if (initial === true) { 1024 _.currentSlide = _.options.initialSlide; 1025 } 1026 _.refresh(initial); 1027 triggerBreakpoint = targetBreakpoint; 1028 } 1029 } 1030 1031 // only trigger breakpoints during an actual break. not on initialize. 1032 if( !initial && triggerBreakpoint !== false ) { 1033 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 1034 } 1035 } 1036 1037 }; 1038 1039 Slick.prototype.changeSlide = function(event, dontAnimate) { 1040 1041 var _ = this, 1042 $target = $(event.currentTarget), 1043 indexOffset, slideOffset, unevenOffset; 1044 1045 // If target is a link, prevent default action. 1046 if($target.is('a')) { 1047 event.preventDefault(); 1048 } 1049 1050 // If target is not the <li> element (ie: a child), find the <li>. 1051 if(!$target.is('li')) { 1052 $target = $target.closest('li'); 1053 } 1054 1055 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 1056 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 1057 1058 switch (event.data.message) { 1059 1060 case 'previous': 1061 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 1062 if (_.slideCount > _.options.slidesToShow) { 1063 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 1064 } 1065 break; 1066 1067 case 'next': 1068 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 1069 if (_.slideCount > _.options.slidesToShow) { 1070 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 1071 } 1072 break; 1073 1074 case 'index': 1075 var index = event.data.index === 0 ? 0 : 1076 event.data.index || $target.index() * _.options.slidesToScroll; 1077 1078 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 1079 $target.children().trigger('focus'); 1080 break; 1081 1082 default: 1083 return; 1084 } 1085 1086 }; 1087 1088 Slick.prototype.checkNavigable = function(index) { 1089 1090 var _ = this, 1091 navigables, prevNavigable; 1092 1093 navigables = _.getNavigableIndexes(); 1094 prevNavigable = 0; 1095 if (index > navigables[navigables.length - 1]) { 1096 index = navigables[navigables.length - 1]; 1097 } else { 1098 for (var n in navigables) { 1099 if (index < navigables[n]) { 1100 index = prevNavigable; 1101 break; 1102 } 1103 prevNavigable = navigables[n]; 1104 } 1105 } 1106 1107 return index; 1108 }; 1109 1110 Slick.prototype.cleanUpEvents = function() { 1111 1112 var _ = this; 1113 1114 if (_.options.dots && _.$dots !== null) { 1115 1116 $('li', _.$dots) 1117 .off('click.slick', _.changeSlide) 1118 .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) 1119 .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1120 1121 } 1122 1123 _.$slider.off('focus.slick blur.slick'); 1124 1125 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1126 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 1127 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 1128 } 1129 1130 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 1131 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 1132 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 1133 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 1134 1135 _.$list.off('click.slick', _.clickHandler); 1136 1137 $(document).off(_.visibilityChange, _.visibility); 1138 1139 _.cleanUpSlideEvents(); 1140 1141 if (_.options.accessibility === true) { 1142 _.$list.off('keydown.slick', _.keyHandler); 1143 } 1144 1145 if (_.options.focusOnSelect === true) { 1146 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 1147 } 1148 1149 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 1150 1151 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 1152 1153 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 1154 1155 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 1156 $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition); 1157 1158 }; 1159 1160 Slick.prototype.cleanUpSlideEvents = function() { 1161 1162 var _ = this; 1163 1164 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 1165 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1166 1167 }; 1168 1169 Slick.prototype.cleanUpRows = function() { 1170 1171 var _ = this, originalSlides; 1172 1173 if(_.options.rows > 1) { 1174 originalSlides = _.$slides.children().children(); 1175 originalSlides.removeAttr('style'); 1176 _.$slider.empty().append(originalSlides); 1177 } 1178 1179 }; 1180 1181 Slick.prototype.clickHandler = function(event) { 1182 1183 var _ = this; 1184 1185 if (_.shouldClick === false) { 1186 event.stopImmediatePropagation(); 1187 event.stopPropagation(); 1188 event.preventDefault(); 1189 } 1190 1191 }; 1192 1193 Slick.prototype.destroy = function(refresh) { 1194 1195 var _ = this; 1196 1197 _.autoPlayClear(); 1198 1199 _.touchObject = {}; 1200 1201 _.cleanUpEvents(); 1202 1203 $('.slick-cloned', _.$slider).detach(); 1204 1205 if (_.$dots) { 1206 _.$dots.remove(); 1207 } 1208 1209 1210 if ( _.$prevArrow && _.$prevArrow.length ) { 1211 1212 _.$prevArrow 1213 .removeClass('slick-disabled slick-arrow slick-hidden') 1214 .removeAttr('aria-hidden aria-disabled tabindex') 1215 .css('display',''); 1216 1217 if ( _.htmlExpr.test( _.options.prevArrow )) { 1218 _.$prevArrow.remove(); 1219 } 1220 } 1221 1222 if ( _.$nextArrow && _.$nextArrow.length ) { 1223 1224 _.$nextArrow 1225 .removeClass('slick-disabled slick-arrow slick-hidden') 1226 .removeAttr('aria-hidden aria-disabled tabindex') 1227 .css('display',''); 1228 1229 if ( _.htmlExpr.test( _.options.nextArrow )) { 1230 _.$nextArrow.remove(); 1231 } 1232 1233 } 1234 1235 1236 if (_.$slides) { 1237 1238 _.$slides 1239 .removeClass('slick-slide slick-active slick-center slick-visible slick-current') 1240 .removeAttr('aria-hidden') 1241 .removeAttr('data-slick-index') 1242 .each(function(){ 1243 $(this).attr('style', $(this).data('originalStyling')); 1244 }); 1245 1246 _.$slideTrack.children(this.options.slide).detach(); 1247 1248 _.$slideTrack.detach(); 1249 1250 _.$list.detach(); 1251 1252 _.$slider.append(_.$slides); 1253 } 1254 1255 _.cleanUpRows(); 1256 1257 _.$slider.removeClass('slick-slider'); 1258 _.$slider.removeClass('slick-initialized'); 1259 _.$slider.removeClass('slick-dotted'); 1260 1261 _.unslicked = true; 1262 1263 if(!refresh) { 1264 _.$slider.trigger('destroy', [_]); 1265 } 1266 1267 }; 1268 1269 Slick.prototype.disableTransition = function(slide) { 1270 1271 var _ = this, 1272 transition = {}; 1273 1274 transition[_.transitionType] = ''; 1275 1276 if (_.options.fade === false) { 1277 _.$slideTrack.css(transition); 1278 } else { 1279 _.$slides.eq(slide).css(transition); 1280 } 1281 1282 }; 1283 1284 Slick.prototype.fadeSlide = function(slideIndex, callback) { 1285 1286 var _ = this; 1287 1288 if (_.cssTransitions === false) { 1289 1290 _.$slides.eq(slideIndex).css({ 1291 zIndex: _.options.zIndex 1292 }); 1293 1294 _.$slides.eq(slideIndex).animate({ 1295 opacity: 1 1296 }, _.options.speed, _.options.easing, callback); 1297 1298 } else { 1299 1300 _.applyTransition(slideIndex); 1301 1302 _.$slides.eq(slideIndex).css({ 1303 opacity: 1, 1304 zIndex: _.options.zIndex 1305 }); 1306 1307 if (callback) { 1308 setTimeout(function() { 1309 1310 _.disableTransition(slideIndex); 1311 1312 callback.call(); 1313 }, _.options.speed); 1314 } 1315 1316 } 1317 1318 }; 1319 1320 Slick.prototype.fadeSlideOut = function(slideIndex) { 1321 1322 var _ = this; 1323 1324 if (_.cssTransitions === false) { 1325 1326 _.$slides.eq(slideIndex).animate({ 1327 opacity: 0, 1328 zIndex: _.options.zIndex - 2 1329 }, _.options.speed, _.options.easing); 1330 1331 } else { 1332 1333 _.applyTransition(slideIndex); 1334 1335 _.$slides.eq(slideIndex).css({ 1336 opacity: 0, 1337 zIndex: _.options.zIndex - 2 1338 }); 1339 1340 } 1341 1342 }; 1343
1344 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 1345 1346 var _ = this; 1347 1348 if (filter !== null) { 1349 1350 _.$slidesCache = _.$slides; 1351 1352 _.unload(); 1353 1354 _.$slideTrack.children(this.options.slide).detach(); 1355 1356 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 1357 1358 _.reinit(); 1359 1360 } 1361 1362 }; 1363 1364 Slick.prototype.focusHandler = function() { 1365 1366 var _ = this; 1367 1368 _.$slider 1369 .off('focus.slick blur.slick') 1370 .on('focus.slick blur.slick', 1371 '*:not(.slick-arrow)', function(event) { 1372 1373 event.stopImmediatePropagation(); 1374 var $sf = $(this); 1375 1376 setTimeout(function() { 1377 1378 if( _.options.pauseOnFocus ) { 1379 _.focussed = $sf.is(':focus'); 1380 _.autoPlay(); 1381 } 1382 1383 }, 0); 1384 1385 }); 1386 }; 1387 1388 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 1389 1390 var _ = this; 1391 return _.currentSlide; 1392 1393 }; 1394 1395 Slick.prototype.getDotCount = function() { 1396 1397 var _ = this; 1398 1399 var breakPoint = 0; 1400 var counter = 0; 1401 var pagerQty = 0; 1402 1403 if (_.options.infinite === true) { 1404 while (breakPoint < _.slideCount) { 1405 ++pagerQty; 1406 breakPoint = counter + _.options.slidesToScroll; 1407 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 1408 } 1409 } else if (_.options.centerMode === true) { 1410 pagerQty = _.slideCount; 1411 } else if(!_.options.asNavFor) { 1412 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 1413 }else { 1414 while (breakPoint < _.slideCount) { 1415 ++pagerQty; 1416 breakPoint = counter + _.options.slidesToScroll; 1417 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 1418 } 1419 } 1420 1421 return pagerQty - 1; 1422 1423 }; 1424 1425 Slick.prototype.getLeft = function(slideIndex) { 1426 1427 var _ = this, 1428 targetLeft, 1429 verticalHeight, 1430 verticalOffset = 0, 1431 targetSlide; 1432 1433 _.slideOffset = 0; 1434 verticalHeight = _.$slides.first().outerHeight(true); 1435 1436 if (_.options.infinite === true) { 1437 if (_.slideCount > _.options.slidesToShow) { 1438 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 1439 verticalOffset = (verticalHeight * _.options.slidesToShow) * -1; 1440 } 1441 if (_.slideCount % _.options.slidesToScroll !== 0) { 1442 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 1443 if (slideIndex > _.slideCount) { 1444 _.slideOffset = ((_.options.slidesToShow - (sl
vendor: 921 bytes, lines 1444-1464
1444ideIndex - _.slideCount)) * _.slideWidth) * -1; 1445 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 1446 } else { 1447 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 1448 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 1449 } 1450 } 1451 } 1452 } else { 1453 if (slideIndex + _.options.slidesToShow > _.slideCount) { 1454 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 1455 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 1456 } 1457 } 1458 1459 if (_.slideCount <= _.options.slidesToShow) { 1460 _.slideOffset = 0; 1461 verticalOffset = 0; 1462 } 1463 1464
vendor: 5,167 bytes, lines 1464-1637
1464 if (_.options.centerMode === true && _.options.infinite === true) { 1465 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 1466 } else if (_.options.centerMode === true) { 1467 _.slideOffset = 0; 1468 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 1469 } 1470 1471 if (_.options.vertical === false) { 1472 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 1473 } else { 1474 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 1475 } 1476 1477 if (_.options.variableWidth === true) { 1478 1479 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 1480 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 1481 } else { 1482 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 1483 } 1484 1485 if (_.options.rtl === true) { 1486 if (targetSlide[0]) { 1487 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 1488 } else { 1489 targetLeft = 0; 1490 } 1491 } else { 1492 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 1493 } 1494 1495 if (_.options.centerMode === true) { 1496 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 1497 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 1498 } else { 1499 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 1500 } 1501 1502 if (_.options.rtl === true) { 1503 if (targetSlide[0]) { 1504 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 1505 } else { 1506 targetLeft = 0; 1507 } 1508 } else { 1509 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 1510 } 1511 1512 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 1513 } 1514 } 1515 1516 return targetLeft; 1517 1518 }; 1519 1520 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 1521 1522 var _ = this; 1523 1524 return _.options[option]; 1525 1526 }; 1527 1528 Slick.prototype.getNavigableIndexes = function() { 1529 1530 var _ = this, 1531 breakPoint = 0, 1532 counter = 0, 1533 indexes = [], 1534 max; 1535 1536 if (_.options.infinite === false) { 1537 max = _.slideCount; 1538 } else { 1539 breakPoint = _.options.slidesToScroll * -1; 1540 counter = _.options.slidesToScroll * -1; 1541 max = _.slideCount * 2; 1542 } 1543 1544 while (breakPoint < max) { 1545 indexes.push(breakPoint); 1546 breakPoint = counter + _.options.slidesToScroll; 1547 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 1548 } 1549 1550 return indexes; 1551 1552 }; 1553 1554 Slick.prototype.getSlick = function() { 1555 1556 return this; 1557 1558 }; 1559 1560 Slick.prototype.getSlideCount = function() { 1561 1562 var _ = this, 1563 slidesTraversed, swipedSlide, centerOffset; 1564 1565 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 1566 1567 if (_.options.swipeToSlide === true) { 1568 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 1569 if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { 1570 swipedSlide = slide; 1571 return false; 1572 } 1573 }); 1574 1575 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 1576 1577 return slidesTraversed; 1578 1579 } else { 1580 return _.options.slidesToScroll; 1581 } 1582 1583 }; 1584 1585 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 1586 1587 var _ = this; 1588 1589 _.changeSlide({ 1590 data: { 1591 message: 'index', 1592 index: parseInt(slide) 1593 } 1594 }, dontAnimate); 1595 1596 }; 1597 1598 Slick.prototype.init = function(creation) { 1599 1600 var _ = this; 1601 1602 if (!$(_.$slider).hasClass('slick-initialized')) { 1603 1604 $(_.$slider).addClass('slick-initialized'); 1605 1606 _.buildRows(); 1607 _.buildOut(); 1608 _.setProps(); 1609 _.startLoad(); 1610 _.loadSlider(); 1611 _.initializeEvents(); 1612 _.updateArrows(); 1613 _.updateDots(); 1614 _.checkResponsive(true); 1615 _.focusHandler(); 1616 1617 } 1618 1619 if (creation) { 1620 _.$slider.trigger('init', [_]); 1621 } 1622 1623 if (_.options.accessibility === true) { 1624 _.initADA(); 1625 } 1626 1627 if ( _.options.autoplay ) { 1628 1629 _.paused = false; 1630 _.autoPlay(); 1631 1632 } 1633 1634 }; 1635 1636 Slick.prototype.initADA = function() { 1637 var _ = this
1637; 1638 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 1639 'aria-hidden': 'true', 1640 'tabindex': '-1' 1641 }).find('a, input, button, select').attr({ 1642 'tabindex': '-1' 1643 }); 1644 1645 _.$slideTrack.attr('role', 'listbox'); 1646 1647 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { 1648 $(this).attr({ 1649 'role': 'option', 1650 'aria-describedby': 'slick-slide' + _.instanceUid + i + '' 1651 }); 1652 }); 1653 1654 if (_.$dots !== null) { 1655 _.$dots.attr('role', 'tablist').find('li').each(function(i) { 1656 $(this).attr({ 1657 'role': 'presentation', 1658 'aria-selected': 'false', 1659 'aria-controls': 'navigation' + _.instanceUid + i + '', 1660 'id': 'slick-slide' + _.instanceUid + i + '' 1661 }); 1662 }) 1663 .first().attr('aria-selected', 'true').end() 1664 .find('button').attr('role', 'button').end() 1665 .closest('div').attr('role', 'toolbar'); 1666 } 1667 _.activateADA(); 1668 1669 }; 1670 1671 Slick.prototype.initArrowEvents = function() { 1672 1673 var _ = this; 1674 1675 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1676 _.$prevArrow 1677 .off('click.slick') 1678 .on('click.slick', { 1679 message: 'previous' 1680 }, _.changeSlide); 1681 _.$nextArrow 1682 .off('click.slick') 1683 .on('click.slick', { 1684 message: 'next' 1685 }, _.changeSlide); 1686 } 1687 1688 }; 1689 1690 Slick.prototype.initDotEvents = function() { 1691 1692 var _ = this; 1693 1694 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 1695 $('li', _.$dots).on('click.slick', { 1696 message: 'index' 1697 }, _.changeSlide); 1698 } 1699 1700 if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) { 1701 1702 $('li', _.$dots) 1703 .on('mouseenter.slick', $.proxy(_.interrupt, _, true)) 1704 .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1705 1706 } 1707 1708 }; 1709 1710 Slick.prototype.initSlideEvents = function() { 1711 1712 var _ = this; 1713 1714 if ( _.options.pauseOnHover ) { 1715 1716 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); 1717 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1718 1719 } 1720 1721 }; 1722 1723 Slick.prototype.initializeEvents = function() { 1724 1725 var _ = this; 1726 1727 _.initArrowEvents(); 1728 1729 _.initDotEvents(); 1730 _.initSlideEvents(); 1731 1732 _.$list.on('touchstart.slick mousedown.slick', { 1733 action: 'start' 1734 }, _.swipeHandler); 1735 _.$list.on('touchmove.slick mousemove.slick', { 1736 action: 'move' 1737 }, _.swipeHandler); 1738 _.$list.on('touchend.slick mouseup.slick', { 1739 action: 'end' 1740 }, _.swipeHandler);
vendor: 10,240 bytes, lines 1741-2118
1741 _.$list.on('touchcancel.slick mouseleave.slick', { 1742 action: 'end' 1743 }, _.swipeHandler); 1744 1745 _.$list.on('click.slick', _.clickHandler); 1746 1747 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 1748 1749 if (_.options.accessibility === true) { 1750 _.$list.on('keydown.slick', _.keyHandler); 1751 } 1752 1753 if (_.options.focusOnSelect === true) { 1754 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 1755 } 1756 1757 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 1758 1759 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 1760 1761 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 1762 1763 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 1764 $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition); 1765 1766 }; 1767 1768 Slick.prototype.initUI = function() { 1769 1770 var _ = this; 1771 1772 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1773 1774 _.$prevArrow.show(); 1775 _.$nextArrow.show(); 1776 1777 } 1778 1779 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 1780 1781 _.$dots.show(); 1782 1783 } 1784 1785 }; 1786 1787 Slick.prototype.keyHandler = function(event) { 1788 1789 var _ = this; 1790 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 1791 if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 1792 if (event.keyCode === 37 && _.options.accessibility === true) { 1793 _.changeSlide({ 1794 data: { 1795 message: _.options.rtl === true ? 'next' : 'previous' 1796 } 1797 }); 1798 } else if (event.keyCode === 39 && _.options.accessibility === true) { 1799 _.changeSlide({ 1800 data: { 1801 message: _.options.rtl === true ? 'previous' : 'next' 1802 } 1803 }); 1804 } 1805 } 1806 1807 }; 1808 1809 Slick.prototype.lazyLoad = function() { 1810 1811 var _ = this, 1812 loadRange, cloneRange, rangeStart, rangeEnd; 1813 1814 function loadImages(imagesScope) { 1815 1816 $('img[data-lazy]', imagesScope).each(function() { 1817 1818 var image = $(this), 1819 imageSource = $(this).attr('data-lazy'), 1820 imageToLoad = document.createElement('img'); 1821 1822 imageToLoad.onload = function() { 1823 1824 image 1825 .animate({ opacity: 0 }, 100, function() { 1826 image 1827 .attr('src', imageSource) 1828 .animate({ opacity: 1 }, 200, function() { 1829 image 1830 .removeAttr('data-lazy') 1831 .removeClass('slick-loading'); 1832 }); 1833 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 1834 }); 1835 1836 }; 1837 1838 imageToLoad.onerror = function() { 1839 1840 image 1841 .removeAttr( 'data-lazy' ) 1842 .removeClass( 'slick-loading' ) 1843 .addClass( 'slick-lazyload-error' ); 1844 1845 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 1846 1847 }; 1848 1849 imageToLoad.src = imageSource; 1850 1851 }); 1852 1853 } 1854 1855 if (_.options.centerMode === true) { 1856 if (_.options.infinite === true) { 1857 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 1858 rangeEnd = rangeStart + _.options.slidesToShow + 2; 1859 } else { 1860 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 1861 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 1862 } 1863 } else { 1864 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 1865 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 1866 if (_.options.fade === true) { 1867 if (rangeStart > 0) rangeStart--; 1868 if (rangeEnd <= _.slideCount) rangeEnd++; 1869 } 1870 } 1871 1872 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 1873 loadImages(loadRange); 1874 1875 if (_.slideCount <= _.options.slidesToShow) { 1876 cloneRange = _.$slider.find('.slick-slide'); 1877 loadImages(cloneRange); 1878 } else 1879 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 1880 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 1881 loadImages(cloneRange); 1882 } else if (_.currentSlide === 0) { 1883 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 1884 loadImages(cloneRange); 1885 } 1886 1887 }; 1888 1889 Slick.prototype.loadSlider = function() { 1890 1891 var _ = this; 1892 1893 _.setPosition(); 1894 1895 _.$slideTrack.css({ 1896 opacity: 1 1897 }); 1898 1899 _.$slider.removeClass('slick-loading'); 1900 1901 _.initUI(); 1902 1903 if (_.options.lazyLoad === 'progressive') { 1904 _.progressiveLazyLoad(); 1905 } 1906 1907 }; 1908 1909 Slick.prototype.next = Slick.prototype.slickNext = function() { 1910 1911 var _ = this; 1912 1913 _.changeSlide({ 1914 data: { 1915 message: 'next' 1916 } 1917 }); 1918 1919 }; 1920 1921 Slick.prototype.orientationChange = function() { 1922 1923 var _ = this; 1924 1925 _.checkResponsive(); 1926 _.setPosition(); 1927 1928 }; 1929 1930 Slick.prototype.pause = Slick.prototype.slickPause = function() { 1931 1932 var _ = this; 1933 1934 _.autoPlayClear(); 1935 _.paused = true; 1936 1937 }; 1938 1939 Slick.prototype.play = Slick.prototype.slickPlay = function() { 1940 1941 var _ = this; 1942 1943 _.autoPlay(); 1944 _.options.autoplay = true; 1945 _.paused = false; 1946 _.focussed = false; 1947 _.interrupted = false; 1948 1949 }; 1950 1951 Slick.prototype.postSlide = function(index) { 1952 1953 var _ = this; 1954 1955 if( !_.unslicked ) { 1956 1957 _.$slider.trigger('afterChange', [_, index]); 1958 1959 _.animating = false; 1960 1961 _.setPosition(); 1962 1963 _.swipeLeft = null; 1964 1965 if ( _.options.autoplay ) { 1966 _.autoPlay(); 1967 } 1968 1969 if (_.options.accessibility === true) { 1970 _.initADA(); 1971 } 1972 1973 } 1974 1975 }; 1976 1977 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 1978 1979 var _ = this; 1980 1981 _.changeSlide({ 1982 data: { 1983 message: 'previous' 1984 } 1985 }); 1986 1987 }; 1988 1989 Slick.prototype.preventDefault = function(event) { 1990 1991 event.preventDefault(); 1992 1993 }; 1994 1995 Slick.prototype.progressiveLazyLoad = function( tryCount ) { 1996 1997 tryCount = tryCount || 1; 1998 1999 var _ = this, 2000 $imgsToLoad = $( 'img[data-lazy]', _.$slider ), 2001 image, 2002 imageSource, 2003 imageToLoad; 2004 2005 if ( $imgsToLoad.length ) { 2006 2007 image = $imgsToLoad.first(); 2008 imageSource = image.attr('data-lazy'); 2009 imageToLoad = document.createElement('img'); 2010 2011 imageToLoad.onload = function() { 2012 2013 image 2014 .attr( 'src', imageSource ) 2015 .removeAttr('data-lazy') 2016 .removeClass('slick-loading'); 2017 2018 if ( _.options.adaptiveHeight === true ) { 2019 _.setPosition(); 2020 } 2021 2022 _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); 2023 _.progressiveLazyLoad(); 2024 2025 }; 2026 2027 imageToLoad.onerror = function() { 2028 2029 if ( tryCount < 3 ) { 2030 2031 /** 2032 * try to load the image 3 times, 2033 * leave a slight delay so we don't get 2034 * servers blocking the request. 2035 */ 2036 setTimeout( function() { 2037 _.progressiveLazyLoad( tryCount + 1 ); 2038 }, 500 ); 2039 2040 } else { 2041 2042 image 2043 .removeAttr( 'data-lazy' ) 2044 .removeClass( 'slick-loading' ) 2045 .addClass( 'slick-lazyload-error' ); 2046 2047 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 2048 2049 _.progressiveLazyLoad(); 2050 2051 } 2052 2053 }; 2054 2055 imageToLoad.src = imageSource; 2056 2057 } else { 2058 2059 _.$slider.trigger('allImagesLoaded', [ _ ]); 2060 2061 } 2062 2063 }; 2064 2065 Slick.prototype.refresh = function( initializing ) { 2066 2067 var _ = this, currentSlide, lastVisibleIndex; 2068 2069 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 2070 2071 // in non-infinite sliders, we don't want to go past the 2072 // last visible index. 2073 if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { 2074 _.currentSlide = lastVisibleIndex; 2075 } 2076 2077 // if less slides than to show, go to start. 2078 if ( _.slideCount <= _.options.slidesToShow ) { 2079 _.currentSlide = 0; 2080 2081 } 2082 2083 currentSlide = _.currentSlide; 2084 2085 _.destroy(true); 2086 2087 $.extend(_, _.initials, { currentSlide: currentSlide }); 2088 2089 _.init(); 2090 2091 if( !initializing ) { 2092 2093 _.changeSlide({ 2094 data: { 2095 message: 'index', 2096 index: currentSlide 2097 } 2098 }, false); 2099 2100 } 2101 2102 }; 2103 2104 Slick.prototype.registerBreakpoints = function() { 2105 2106 var _ = this, breakpoint, currentBreakpoint, l, 2107 responsiveSettings = _.options.responsive || null; 2108 2109 if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { 2110 2111 _.respondTo = _.options.respondTo || 'window'; 2112 2113 for ( breakpoint in responsiveSettings ) { 2114 2115 l = _.breakpoints.length-1; 2116 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 2117 2118 if (responsiveSettings.hasOwnProperty(breakpoint)) {
vendor: 12,466 bytes, lines 2118-2551
2118 2119 2120 // loop through the breakpoints and cut out any existing 2121 // ones with the same breakpoint number, we don't want dupes. 2122 while( l >= 0 ) { 2123 if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { 2124 _.breakpoints.splice(l,1); 2125 } 2126 l--; 2127 } 2128 2129 _.breakpoints.push(currentBreakpoint); 2130 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 2131 2132 } 2133 2134 } 2135 2136 _.breakpoints.sort(function(a, b) { 2137 return ( _.options.mobileFirst ) ? a-b : b-a; 2138 }); 2139 2140 } 2141 2142 }; 2143 2144 Slick.prototype.reinit = function() { 2145 2146 var _ = this; 2147 2148 _.$slides = 2149 _.$slideTrack 2150 .children(_.options.slide) 2151 .addClass('slick-slide'); 2152 2153 _.slideCount = _.$slides.length; 2154 2155 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 2156 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 2157 } 2158 2159 if (_.slideCount <= _.options.slidesToShow) { 2160 _.currentSlide = 0; 2161 } 2162 2163 _.registerBreakpoints(); 2164 2165 _.setProps(); 2166 _.setupInfinite(); 2167 _.buildArrows(); 2168 _.updateArrows(); 2169 _.initArrowEvents(); 2170 _.buildDots(); 2171 _.updateDots(); 2172 _.initDotEvents(); 2173 _.cleanUpSlideEvents(); 2174 _.initSlideEvents(); 2175 2176 _.checkResponsive(false, true); 2177 2178 if (_.options.focusOnSelect === true) { 2179 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 2180 } 2181 2182 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 2183 2184 _.setPosition(); 2185 _.focusHandler(); 2186 2187 _.paused = !_.options.autoplay; 2188 _.autoPlay(); 2189 2190 _.$slider.trigger('reInit', [_]); 2191 2192 }; 2193 2194 Slick.prototype.resize = function() { 2195 2196 var _ = this; 2197 2198 if ($(window).width() !== _.windowWidth) { 2199 clearTimeout(_.windowDelay); 2200 _.windowDelay = window.setTimeout(function() { 2201 _.windowWidth = $(window).width(); 2202 _.checkResponsive(); 2203 if( !_.unslicked ) { _.setPosition(); } 2204 }, 50); 2205 } 2206 }; 2207 2208 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 2209 2210 var _ = this; 2211 2212 if (typeof(index) === 'boolean') { 2213 removeBefore = index; 2214 index = removeBefore === true ? 0 : _.slideCount - 1; 2215 } else { 2216 index = removeBefore === true ? --index : index; 2217 } 2218 2219 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 2220 return false; 2221 } 2222 2223 _.unload(); 2224 2225 if (removeAll === true) { 2226 _.$slideTrack.children().remove(); 2227 } else { 2228 _.$slideTrack.children(this.options.slide).eq(index).remove(); 2229 } 2230 2231 _.$slides = _.$slideTrack.children(this.options.slide); 2232 2233 _.$slideTrack.children(this.options.slide).detach(); 2234 2235 _.$slideTrack.append(_.$slides); 2236 2237 _.$slidesCache = _.$slides; 2238 2239 _.reinit(); 2240 2241 }; 2242 2243 Slick.prototype.setCSS = function(position) { 2244 2245 var _ = this, 2246 positionProps = {}, 2247 x, y; 2248 2249 if (_.options.rtl === true) { 2250 position = -position; 2251 } 2252 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 2253 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 2254 2255 positionProps[_.positionProp] = position; 2256 2257 if (_.transformsEnabled === false) { 2258 _.$slideTrack.css(positionProps); 2259 } else { 2260 positionProps = {}; 2261 if (_.cssTransitions === false) { 2262 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 2263 _.$slideTrack.css(positionProps); 2264 } else { 2265 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 2266 _.$slideTrack.css(positionProps); 2267 } 2268 } 2269 2270 }; 2271 2272 Slick.prototype.setDimensions = function() { 2273 2274 var _ = this; 2275 2276 if (_.options.vertical === false) { 2277 if (_.options.centerMode === true) { 2278 _.$list.css({ 2279 padding: ('0px ' + _.options.centerPadding) 2280 }); 2281 } 2282 } else { 2283 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 2284 if (_.options.centerMode === true) { 2285 _.$list.css({ 2286 padding: (_.options.centerPadding + ' 0px') 2287 }); 2288 } 2289 } 2290 2291 _.listWidth = _.$list.width(); 2292 _.listHeight = _.$list.height(); 2293 2294 2295 if (_.options.vertical === false && _.options.variableWidth === false) { 2296 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 2297 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 2298 2299 } else if (_.options.variableWidth === true) { 2300 _.$slideTrack.width(5000 * _.slideCount); 2301 } else { 2302 _.slideWidth = Math.ceil(_.listWidth); 2303 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 2304 } 2305 2306 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 2307 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 2308 2309 }; 2310 2311 Slick.prototype.setFade = function() { 2312 2313 var _ = this, 2314 targetLeft; 2315 2316 _.$slides.each(function(index, element) { 2317 targetLeft = (_.slideWidth * index) * -1; 2318 if (_.options.rtl === true) { 2319 $(element).css({ 2320 position: 'relative', 2321 right: targetLeft, 2322 top: 0, 2323 zIndex: _.options.zIndex - 2, 2324 opacity: 0 2325 }); 2326 } else { 2327 $(element).css({ 2328 position: 'relative', 2329 left: targetLeft, 2330 top: 0, 2331 zIndex: _.options.zIndex - 2, 2332 opacity: 0 2333 }); 2334 } 2335 }); 2336 2337 _.$slides.eq(_.currentSlide).css({ 2338 zIndex: _.options.zIndex - 1, 2339 opacity: 1 2340 }); 2341 2342 }; 2343 2344 Slick.prototype.setHeight = function() { 2345 2346 var _ = this; 2347 2348 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 2349 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 2350 _.$list.css('height', targetHeight); 2351 } 2352 2353 }; 2354 2355 Slick.prototype.setOption = 2356 Slick.prototype.slickSetOption = function() { 2357 2358 /** 2359 * accepts arguments in format of: 2360 * 2361 * - for changing a single option's value: 2362 * .slick("setOption", option, value, refresh ) 2363 * 2364 * - for changing a set of responsive options: 2365 * .slick("setOption", 'responsive', [{}, ...], refresh ) 2366 * 2367 * - for updating multiple values at once (not responsive) 2368 * .slick("setOption", { 'option': value, ... }, refresh ) 2369 */ 2370 2371 var _ = this, l, item, option, value, refresh = false, type; 2372 2373 if( $.type( arguments[0] ) === 'object' ) { 2374 2375 option = arguments[0]; 2376 refresh = arguments[1]; 2377 type = 'multiple'; 2378 2379 } else if ( $.type( arguments[0] ) === 'string' ) { 2380 2381 option = arguments[0]; 2382 value = arguments[1]; 2383 refresh = arguments[2]; 2384 2385 if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { 2386 2387 type = 'responsive'; 2388 2389 } else if ( typeof arguments[1] !== 'undefined' ) { 2390 2391 type = 'single'; 2392 2393 } 2394 2395 } 2396 2397 if ( type === 'single' ) { 2398 2399 _.options[option] = value; 2400 2401 2402 } else if ( type === 'multiple' ) { 2403 2404 $.each( option , function( opt, val ) { 2405 2406 _.options[opt] = val; 2407 2408 }); 2409 2410 2411 } else if ( type === 'responsive' ) { 2412 2413 for ( item in value ) { 2414 2415 if( $.type( _.options.responsive ) !== 'array' ) { 2416 2417 _.options.responsive = [ value[item] ]; 2418 2419 } else { 2420 2421 l = _.options.responsive.length-1; 2422 2423 // loop through the responsive object and splice out duplicates. 2424 while( l >= 0 ) { 2425 2426 if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { 2427 2428 _.options.responsive.splice(l,1); 2429 2430 } 2431 2432 l--; 2433 2434 } 2435 2436 _.options.responsive.push( value[item] ); 2437 2438 } 2439 2440 } 2441 2442 } 2443 2444 if ( refresh ) { 2445 2446 _.unload(); 2447 _.reinit(); 2448 2449 } 2450 2451 }; 2452 2453 Slick.prototype.setPosition = function() { 2454 2455 var _ = this; 2456 2457 _.setDimensions(); 2458 2459 _.setHeight(); 2460 2461 if (_.options.fade === false) { 2462 _.setCSS(_.getLeft(_.currentSlide)); 2463 } else { 2464 _.setFade(); 2465 } 2466 2467 _.$slider.trigger('setPosition', [_]); 2468 2469 }; 2470 2471 Slick.prototype.setProps = function() { 2472 2473 var _ = this, 2474 bodyStyle = document.body.style; 2475 2476 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 2477 2478 if (_.positionProp === 'top') { 2479 _.$slider.addClass('slick-vertical'); 2480 } else { 2481 _.$slider.removeClass('slick-vertical'); 2482 } 2483 2484 if (bodyStyle.WebkitTransition !== undefined || 2485 bodyStyle.MozTransition !== undefined || 2486 bodyStyle.msTransition !== undefined) { 2487 if (_.options.useCSS === true) { 2488 _.cssTransitions = true; 2489 } 2490 } 2491 2492 if ( _.options.fade ) { 2493 if ( typeof _.options.zIndex === 'number' ) { 2494 if( _.options.zIndex < 3 ) { 2495 _.options.zIndex = 3; 2496 } 2497 } else { 2498 _.options.zIndex = _.defaults.zIndex; 2499 } 2500 } 2501 2502 if (bodyStyle.OTransform !== undefined) { 2503 _.animType = 'OTransform'; 2504 _.transformType = '-o-transform'; 2505 _.transitionType = 'OTransition'; 2506 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 2507 } 2508 if (bodyStyle.MozTransform !== undefined) { 2509 _.animType = 'MozTransform'; 2510 _.transformType = '-moz-transform'; 2511 _.transitionType = 'MozTransition'; 2512 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 2513 } 2514 if (bodyStyle.webkitTransform !== undefined) { 2515 _.animType = 'webkitTransform'; 2516 _.transformType = '-webkit-transform'; 2517 _.transitionType = 'webkitTransition'; 2518 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 2519 } 2520 if (bodyStyle.msTransform !== undefined) { 2521 _.animType = 'msTransform'; 2522 _.transformType = '-ms-transform'; 2523 _.transitionType = 'msTransition'; 2524 if (bodyStyle.msTransform === undefined) _.animType = false; 2525 } 2526 if (bodyStyle.transform !== undefined && _.animType !== false) { 2527 _.animType = 'transform'; 2528 _.transformType = 'transform'; 2529 _.transitionType = 'transition'; 2530 } 2531 _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); 2532 }; 2533 2534 2535 Slick.prototype.setSlideClasses = function(index) { 2536 2537 var _ = this, 2538 centerOffset, allSlides, indexOffset, remainder; 2539 2540 allSlides = _.$slider 2541 .find('.slick-slide') 2542 .removeClass('slick-active slick-center slick-current') 2543 .attr('aria-hidden', 'true'); 2544 2545 _.$slides 2546 .eq(index) 2547 .addClass('slick-current'); 2548 2549 if (_.options.centerMode === true) { 2550 2551
2551centerOffset = Math.floor(_.options.slidesToShow / 2); 2552 2553 if (_.options.infinite === true) { 2554 2555 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 2556 2557 _.$slides 2558 .slice(index - centerOffset, index + centerOffset + 1) 2559 .addClass('slick-active') 2560 .attr('aria-hidden', 'false'); 2561 2562 } else { 2563 2564 indexOffset = _.options.slidesToShow + index; 2565 allSlides 2566 .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2) 2567 .addClass('slick-active') 2568 .attr('aria-hidden', 'false'); 2569 2570 } 2571 2572 if (index === 0) { 2573 2574 allSlides 2575 .eq(allSlides.length - 1 - _.options.slidesToShow) 2576 .addClass('slick-center'); 2577 2578 } else if (index === _.slideCount - 1) { 2579 2580 allSlides 2581 .eq(_.options.slidesToShow) 2582 .addClass('slick-center'); 2583 2584 } 2585 2586 } 2587 2588 _.$slides 2589 .eq(index) 2590 .addClass('slick-center'); 2591 2592 } else { 2593 2594 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 2595 2596 _.$slides 2597 .slice(index, index + _.options.slidesToShow) 2598 .addClass('slick-active') 2599 .attr('aria-hidden', 'false'); 2600 2601 } else if (allSlides.length <= _.options.slidesToShow) { 2602 2603 allSlides 2604 .addClass('slick-active') 2605 .attr('aria-hidden', 'false'); 2606 2607 } else { 2608 2609 remainder = _.slideCount % _.options.slidesToShow; 2610 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 2611 2612 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 2613 2614 allSlides 2615 .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) 2616 .addClass('slick-active') 2617 .attr('aria-hidden', 'false'); 2618 2619 } else { 2620 2621 allSlides 2622 .slice(indexOffset, indexOffset + _.options.slidesToShow) 2623 .addClass('slick-active') 2624 .attr('aria-hidden', 'false'); 2625 2626 } 2627 2628 } 2629 2630 } 2631 2632 if (_.options.lazyLoad === 'ondemand') { 2633 _.lazyLoad(); 2634 } 2635 2636 }; 2637 2638 Slick.prototype.setupInfinite = function() { 2639 2640 var _ = this, 2641 i, slideIndex, infiniteCount; 2642 2643 if (_.options.fade === true) {
vendor: 15,027 bytes, lines 2644-3177
2644 _.options.centerMode = false; 2645 } 2646 2647 if (_.options.infinite === true && _.options.fade === false) { 2648 2649 slideIndex = null; 2650 2651 if (_.slideCount > _.options.slidesToShow) { 2652 2653 if (_.options.centerMode === true) { 2654 infiniteCount = _.options.slidesToShow + 1; 2655 } else { 2656 infiniteCount = _.options.slidesToShow; 2657 } 2658 2659 for (i = _.slideCount; i > (_.slideCount - 2660 infiniteCount); i -= 1) { 2661 slideIndex = i - 1; 2662 $(_.$slides[slideIndex]).clone(true).attr('id', '') 2663 .attr('data-slick-index', slideIndex - _.slideCount) 2664 .prependTo(_.$slideTrack).addClass('slick-cloned'); 2665 } 2666 for (i = 0; i < infiniteCount; i += 1) { 2667 slideIndex = i; 2668 $(_.$slides[slideIndex]).clone(true).attr('id', '') 2669 .attr('data-slick-index', slideIndex + _.slideCount) 2670 .appendTo(_.$slideTrack).addClass('slick-cloned'); 2671 } 2672 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 2673 $(this).attr('id', ''); 2674 }); 2675 2676 } 2677 2678 } 2679 2680 }; 2681 2682 Slick.prototype.interrupt = function( toggle ) { 2683 2684 var _ = this; 2685 2686 if( !toggle ) { 2687 _.autoPlay(); 2688 } 2689 _.interrupted = toggle; 2690 2691 }; 2692 2693 Slick.prototype.selectHandler = function(event) { 2694 2695 var _ = this; 2696 2697 var targetElement = 2698 $(event.target).is('.slick-slide') ? 2699 $(event.target) : 2700 $(event.target).parents('.slick-slide'); 2701 2702 var index = parseInt(targetElement.attr('data-slick-index')); 2703 2704 if (!index) index = 0; 2705 2706 if (_.slideCount <= _.options.slidesToShow) { 2707 2708 _.setSlideClasses(index); 2709 _.asNavFor(index); 2710 return; 2711 2712 } 2713 2714 _.slideHandler(index); 2715 2716 }; 2717 2718 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 2719 2720 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 2721 _ = this, navTarget; 2722 2723 sync = sync || false; 2724 2725 if (_.animating === true && _.options.waitForAnimate === true) { 2726 return; 2727 } 2728 2729 if (_.options.fade === true && _.currentSlide === index) { 2730 return; 2731 } 2732 2733 if (_.slideCount <= _.options.slidesToShow) { 2734 return; 2735 } 2736 2737 if (sync === false) { 2738 _.asNavFor(index); 2739 } 2740 2741 targetSlide = index; 2742 targetLeft = _.getLeft(targetSlide); 2743 slideLeft = _.getLeft(_.currentSlide); 2744 2745 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 2746 2747 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 2748 if (_.options.fade === false) { 2749 targetSlide = _.currentSlide; 2750 if (dontAnimate !== true) { 2751 _.animateSlide(slideLeft, function() { 2752 _.postSlide(targetSlide); 2753 }); 2754 } else { 2755 _.postSlide(targetSlide); 2756 } 2757 } 2758 return; 2759 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 2760 if (_.options.fade === false) { 2761 targetSlide = _.currentSlide; 2762 if (dontAnimate !== true) { 2763 _.animateSlide(slideLeft, function() { 2764 _.postSlide(targetSlide); 2765 }); 2766 } else { 2767 _.postSlide(targetSlide); 2768 } 2769 } 2770 return; 2771 } 2772 2773 if ( _.options.autoplay ) { 2774 clearInterval(_.autoPlayTimer); 2775 } 2776 2777 if (targetSlide < 0) { 2778 if (_.slideCount % _.options.slidesToScroll !== 0) { 2779 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 2780 } else { 2781 animSlide = _.slideCount + targetSlide; 2782 } 2783 } else if (targetSlide >= _.slideCount) { 2784 if (_.slideCount % _.options.slidesToScroll !== 0) { 2785 animSlide = 0; 2786 } else { 2787 animSlide = targetSlide - _.slideCount; 2788 } 2789 } else { 2790 animSlide = targetSlide; 2791 } 2792 2793 _.animating = true; 2794 2795 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 2796 2797 oldSlide = _.currentSlide; 2798 _.currentSlide = animSlide; 2799 2800 _.setSlideClasses(_.currentSlide); 2801 2802 if ( _.options.asNavFor ) { 2803 2804 navTarget = _.getNavTarget(); 2805 navTarget = navTarget.slick('getSlick'); 2806 2807 if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { 2808 navTarget.setSlideClasses(_.currentSlide); 2809 } 2810 2811 } 2812 2813 _.updateDots(); 2814 _.updateArrows(); 2815 2816 if (_.options.fade === true) { 2817 if (dontAnimate !== true) { 2818 2819 _.fadeSlideOut(oldSlide); 2820 2821 _.fadeSlide(animSlide, function() { 2822 _.postSlide(animSlide); 2823 }); 2824 2825 } else { 2826 _.postSlide(animSlide); 2827 } 2828 _.animateHeight(); 2829 return; 2830 } 2831 2832 if (dontAnimate !== true) { 2833 _.animateSlide(targetLeft, function() { 2834 _.postSlide(animSlide); 2835 }); 2836 } else { 2837 _.postSlide(animSlide); 2838 } 2839 2840 }; 2841 2842 Slick.prototype.startLoad = function() { 2843 2844 var _ = this; 2845 2846 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 2847 2848 _.$prevArrow.hide(); 2849 _.$nextArrow.hide(); 2850 2851 } 2852 2853 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 2854 2855 _.$dots.hide(); 2856 2857 } 2858 2859 _.$slider.addClass('slick-loading'); 2860 2861 }; 2862 2863 Slick.prototype.swipeDirection = function() { 2864 2865 var xDist, yDist, r, swipeAngle, _ = this; 2866 2867 xDist = _.touchObject.startX - _.touchObject.curX; 2868 yDist = _.touchObject.startY - _.touchObject.curY; 2869 r = Math.atan2(yDist, xDist); 2870 2871 swipeAngle = Math.round(r * 180 / Math.PI); 2872 if (swipeAngle < 0) { 2873 swipeAngle = 360 - Math.abs(swipeAngle); 2874 } 2875 2876 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 2877 return (_.options.rtl === false ? 'left' : 'right'); 2878 } 2879 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 2880 return (_.options.rtl === false ? 'left' : 'right'); 2881 } 2882 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 2883 return (_.options.rtl === false ? 'right' : 'left'); 2884 } 2885 if (_.options.verticalSwiping === true) { 2886 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 2887 return 'down'; 2888 } else { 2889 return 'up'; 2890 } 2891 } 2892 2893 return 'vertical'; 2894 2895 }; 2896 2897 Slick.prototype.swipeEnd = function(event) { 2898 2899 var _ = this, 2900 slideCount, 2901 direction; 2902 2903 _.dragging = false; 2904 _.interrupted = false; 2905 _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; 2906 2907 if ( _.touchObject.curX === undefined ) { 2908 return false; 2909 } 2910 2911 if ( _.touchObject.edgeHit === true ) { 2912 _.$slider.trigger('edge', [_, _.swipeDirection() ]); 2913 } 2914 2915 if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { 2916 2917 direction = _.swipeDirection(); 2918 2919 switch ( direction ) { 2920 2921 case 'left': 2922 case 'down': 2923 2924 slideCount = 2925 _.options.swipeToSlide ? 2926 _.checkNavigable( _.currentSlide + _.getSlideCount() ) : 2927 _.currentSlide + _.getSlideCount(); 2928 2929 _.currentDirection = 0; 2930 2931 break; 2932 2933 case 'right': 2934 case 'up': 2935 2936 slideCount = 2937 _.options.swipeToSlide ? 2938 _.checkNavigable( _.currentSlide - _.getSlideCount() ) : 2939 _.currentSlide - _.getSlideCount(); 2940 2941 _.currentDirection = 1; 2942 2943 break; 2944 2945 default: 2946 2947 2948 } 2949 2950 if( direction != 'vertical' ) { 2951 2952 _.slideHandler( slideCount ); 2953 _.touchObject = {}; 2954 _.$slider.trigger('swipe', [_, direction ]); 2955 2956 } 2957 2958 } else { 2959 2960 if ( _.touchObject.startX !== _.touchObject.curX ) { 2961 2962 _.slideHandler( _.currentSlide ); 2963 _.touchObject = {}; 2964 2965 } 2966 2967 } 2968 2969 }; 2970 2971 Slick.prototype.swipeHandler = function(event) { 2972 2973 var _ = this; 2974 2975 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 2976 return; 2977 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 2978 return; 2979 } 2980 2981 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 2982 event.originalEvent.touches.length : 1; 2983 2984 _.touchObject.minSwipe = _.listWidth / _.options 2985 .touchThreshold; 2986 2987 if (_.options.verticalSwiping === true) { 2988 _.touchObject.minSwipe = _.listHeight / _.options 2989 .touchThreshold; 2990 } 2991 2992 switch (event.data.action) { 2993 2994 case 'start': 2995 _.swipeStart(event); 2996 break; 2997 2998 case 'move': 2999 _.swipeMove(event); 3000 break; 3001 3002 case 'end': 3003 _.swipeEnd(event); 3004 break; 3005 3006 } 3007 3008 }; 3009 3010 Slick.prototype.swipeMove = function(event) { 3011 3012 var _ = this, 3013 edgeWasHit = false, 3014 curLeft, swipeDirection, swipeLength, positionOffset, touches; 3015 3016 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 3017 3018 if (!_.dragging || touches && touches.length !== 1) { 3019 return false; 3020 } 3021 3022 curLeft = _.getLeft(_.currentSlide); 3023 3024 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 3025 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 3026 3027 _.touchObject.swipeLength = Math.round(Math.sqrt( 3028 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 3029 3030 if (_.options.verticalSwiping === true) { 3031 _.touchObject.swipeLength = Math.round(Math.sqrt( 3032 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 3033 } 3034 3035 swipeDirection = _.swipeDirection(); 3036 3037 if (swipeDirection === 'vertical') { 3038 return; 3039 } 3040 3041 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 3042 event.preventDefault(); 3043 } 3044 3045 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 3046 if (_.options.verticalSwiping === true) { 3047 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 3048 } 3049 3050 3051 swipeLength = _.touchObject.swipeLength; 3052 3053 _.touchObject.edgeHit = false; 3054 3055 if (_.options.infinite === false) { 3056 if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { 3057 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 3058 _.touchObject.edgeHit = true; 3059 } 3060 } 3061 3062 if (_.options.vertical === false) { 3063 _.swipeLeft = curLeft + swipeLength * positionOffset; 3064 } else { 3065 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 3066 } 3067 if (_.options.verticalSwiping === true) { 3068 _.swipeLeft = curLeft + swipeLength * positionOffset; 3069 } 3070 3071 if (_.options.fade === true || _.options.touchMove === false) { 3072 return false; 3073 } 3074 3075 if (_.animating === true) { 3076 _.swipeLeft = null; 3077 return false; 3078 } 3079 3080 _.setCSS(_.swipeLeft); 3081 3082 }; 3083 3084 Slick.prototype.swipeStart = function(event) { 3085 3086 var _ = this, 3087 touches; 3088 3089 _.interrupted = true; 3090 3091 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 3092 _.touchObject = {}; 3093 return false; 3094 } 3095 3096 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 3097 touches = event.originalEvent.touches[0]; 3098 } 3099 3100 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 3101 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 3102 3103 _.dragging = true; 3104 3105 }; 3106 3107 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 3108 3109 var _ = this; 3110 3111 if (_.$slidesCache !== null) { 3112 3113 _.unload(); 3114 3115 _.$slideTrack.children(this.options.slide).detach(); 3116 3117 _.$slidesCache.appendTo(_.$slideTrack); 3118 3119 _.reinit(); 3120 3121 } 3122 3123 }; 3124 3125 Slick.prototype.unload = function() { 3126 3127 var _ = this; 3128 3129 $('.slick-cloned', _.$slider).remove(); 3130 3131 if (_.$dots) { 3132 _.$dots.remove(); 3133 } 3134 3135 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 3136 _.$prevArrow.remove(); 3137 } 3138 3139 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 3140 _.$nextArrow.remove(); 3141 } 3142 3143 _.$slides 3144 .removeClass('slick-slide slick-active slick-visible slick-current') 3145 .attr('aria-hidden', 'true') 3146 .css('width', ''); 3147 3148 }; 3149 3150 Slick.prototype.unslick = function(fromBreakpoint) { 3151 3152 var _ = this; 3153 _.$slider.trigger('unslick', [_, fromBreakpoint]); 3154 _.destroy(); 3155 3156 }; 3157 3158 Slick.prototype.updateArrows = function() { 3159 3160 var _ = this, 3161 centerOffset; 3162 3163 centerOffset = Math.floor(_.options.slidesToShow / 2); 3164 3165 if ( _.options.arrows === true && 3166 _.slideCount > _.options.slidesToShow && 3167 !_.options.infinite ) { 3168 3169 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3170 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3171 3172 if (_.currentSlide === 0) { 3173 3174 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3175 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3176 3177 } else if (_.currentSlide >
3177= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 3178 3179 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3180 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3181 3182 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 3183 3184 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3185 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3186 3187 } 3188 3189 } 3190 3191 }; 3192 3193 Slick.prototype.updateDots = function() { 3194 3195 var _ = this; 3196 3197 if (_.$dots !== null) { 3198 3199 _.$dots 3200 .find('li') 3201 .removeClass('slick-active') 3202 .attr('aria-hidden', 'true'); 3203 3204 _.$dots 3205 .find('li') 3206 .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) 3207 .addClass('slick-active') 3208 .attr('aria-hidden', 'false'); 3209 3210 } 3211 3212 }; 3213 3214 Slick.prototype.visibility = function() { 3215 3216 var _ = this; 3217 3218 if ( _.options.autoplay ) { 3219 3220 if ( document[_.hidden] ) { 3221 3222 _.interrupted = true; 3223 3224 } else { 3225 3226 _.interrupted = false; 3227 3228 } 3229 3230 } 3231 3232 }; 3233 3234 $.fn.slick = function() { 3235 var _ = this, 3236 opt = arguments[0], 3237 args = Array.prototype.slice.call(arguments, 1), 3238 l = _.length, 3239 i, 3240 ret; 3241 for (i = 0; i < l; i++) { 3242 if (typeof opt == 'object' || typeof opt == 'undefined') 3243 _[i].slick = new Slick(_[i], opt); 3244 else 3245 ret = _[i].slick[opt].apply(_[i].slick, args); 3246 if (typeof ret != 'undefined') return ret; 3247 } 3248 return _; 3249 }; 3250 3251})); 3252 3253$(function(){ 3254// ìë¨ ë©ì¸ ë°°ë ì¬ë¼ì´ë 3255$('.main-bn > .slider > .page-btns > .page-btn').click(function(){ 3256 var $clicked = $(this); 3257 var $slider = $(this).closest('.slider'); 3258 3259 var index = $(this).index(); 3260 var isLeft = index == 0; 3261 //console.log(index); 3262 3263 var $current = $slider.find(' > .slides > .bn.active'); 3264 var $post; 3265 3266 if ( isLeft ){ 3267 $post = $current.prev(); 3268 } 3269 else { 3270 $post = $current.next(); 3271 } 3272 //console.log($post.length); 3273 3274 if ( $post.length == 0 ){ 3275 if ( isLeft ){ 3276 $post = $slider.find(' > .slides > .bn:last-child'); 3277 } 3278 else { 3279 $post = $slider.find(' > .slides > .bn:first-child'); 3280 } 3281 } 3282 3283 $current.removeClass('active'); 3284 $post.addClass('active'); 3285 3286 updateCurrentPageNumber(); 3287}); 3288 3289function next(){ 3290 $('.main-bn > .slider > .page-btns > .next-btn').click(); 3291} 3292 3293let interval = setInterval(next, 10000); 3294let toggle = true; 3295let stop = document.querySelector('.main-bn > .slider > .page-btns > .page-control'); 3296stop.onclick = function(e){ 3297 if(toggle){ 3298 stop.classList.add('stop') 3299 // ë°ë³µ ì¤ë¨ 3300 clearInterval(interval); 3301 toggle = false; 3302 }else{ 3303 stop.classList.remove('stop') 3304 // ë°ë³µ ì¬ê°(ì¬ìì) 3305 interval = setInterval(next, 10000); 3306 toggle = true; 3307 } 3308} 3309 3310 3311// ì¬ë¼ì´ë íì´ì§ ë²í¸ ì§ì 3312function pageNumber__Init(){ 3313 // ì ì± ë°°ë íì´ì§ ê°¯ì ì¸í í´ì .slider ì 'data-slide-total' ë£ê¸° 3314 var totalSlideNo = $('.main-bn > .slider > .slides > .bn').length; 3315 //console.log(totalSlideNo); 3316 3317 $('.main-bn > .slider').attr('data-slide-total', totalSlideNo); 3318 3319 // ê° ë°°ë íì´ì§ ë²í¸ 매기기 3320 $('.main-bn > .slider > .slides > .bn').each(function(index, node){ 3321 $(node).attr('data-slide-no', index + 1); 3322 }); 3323}; 3324 3325pageNumber__Init(); 3326 3327// ì¬ë¼ì´ë ì´ëì íì´ì§ ë²í¸ ë³ê²½ 3328function updateCurrentPageNumber(){ 3329 var totalSlideNo = $('.main-bn > .slider').attr('data-slide-total'); 3330 var currentSlideNo = $('.main-bn > .slider > .slides > .bn.active').attr('data-slide-no'); 3331 3332 $('.main-bn > .slider > .page-btns > .page-no > .total-slide-no').html(totalSlideNo); 3333 $('.main-bn > .slider > .page-btns > .page-no > .current-slide-no').html(currentSlideNo); 3334}; 3335 3336updateCurrentPageNumber() 3337 3338// ë©ì¸ë² ë ì 체보기 3339$('.main-bn > .slider > .bn_view_btn').on('click', function(){ 3340 $('.main-bn > .bn_view').show(); 3341 let len = $('.main-bn > .bn_view ol li').length; 3342 if (len > 5) { 3343 $('.main-bn > .bn_view ol').css('overflow-y','scroll') 3344 } 3345}) 3346$('.main-bn > .bn_view .close').on('click', function(){ 3347 $('.main-bn > .bn_view').hide(); 3348}); 3349 3350 // .main-mv 3351 var mainMv = $(".main-mv"); 3352 mainMv.slick({ 3353 autoplay: true, 3354 speed: 700, 3355 fade: false, 3356 arrows: true, 3357 dots: false, 3358 // centerMode:true, 3359 // variableWidth: true, 3360 slide: '.item' 3361 }); 3362 3363 3364 3365 if($(window).width() < 768) { 3366// window í¬ê¸°ê° 768ë³´ë¤ ììë 3367 var mainK = $(".main-k .prdList"); 3368 mainK.slick({ 3369 autoplay: false, 3370 speed: 300, 3371 fade: false, 3372 arrows: true, 3373 dots: false, 3374 slidesToShow: 3, 3375 slidesToScroll: 3, 3376 infinite: true 3377 }); 3378} else { 3379// window í¬ê¸°ê° 768ë³´ë¤ í´ë 3380 var mainK = $(".main-k .prdList"); 3381 mainK.slick({ 3382 autoplay: false, 3383 speed: 300, 3384 fade: false, 3385 arrows: true, 3386 dots: false, 3387 slidesToShow: 6, 3388 slidesToScroll: 6, 3389 infinite: true 3390 }); 3391} 3392 3393 3394 3395 // .main-new 3396 var mainNew = $(".main-new .prdList"); 3397 mainNew.slick({ 3398 autoplay: false, 3399 speed: 300, 3400 fade: false, 3401 arrows: true, 3402 dots: true, 3403 slidesToShow: 5, 3404 slidesToScroll: 1 3405 }); 3406 3407// .main-eventList grab scroll 3408var eventList = $(".main-eventList .eventList"); 3409var isDown = false;
3410var startX; 3411var scrollLeft; 3412var isDragging = false; 3413 3414eventList.on("mousedown", function(e) { 3415 isDown = true; 3416 startX = e.pageX; 3417 scrollLeft = this.scrollLeft; 3418 isDragging = false; 3419 $("body").css("user-select", "none"); 3420}); 3421 3422eventList.on("mouseleave mouseup", function() { 3423 isDown = false; 3424 $("body").css("user-select", ""); 3425}); 3426 3427eventList.on("mousemove", function(e) { 3428 if (!isDown) return; 3429 e.preventDefault(); 3430 var x = e.pageX; 3431 var walk = (x - startX) * 1; // ëëê·¸ 민ê°ë 3432 if (Math.abs(walk) > 5) { // 5px ì´ì ìì§ì´ë©´ ëëê·¸ë¡ ì¸ì 3433 isDragging = true; 3434 } 3435 this.scrollLeft = scrollLeft - walk; 3436}); 3437 3438// ëëê·¸ ì¤ìë aíê·¸ í´ë¦ ë§ê¸° 3439eventList.find("a").on("click", function(e) { 3440 if (isDragging) { 3441 e.preventDefault(); 3442 } 3443}); 3444 3445 // .main-recommend 3446 var mainRecommend = $(".main-recommend .prdList"); 3447 mainRecommend.slick({ 3448 autoplay: false, 3449 speed: 300, 3450 fade: false, 3451 arrows: true, 3452 dots: false, 3453 slidesToShow: 5, 3454 slidesToScroll: 1 3455 }); 3456 3457 var mainRecommend_tab = $(".main-recommend .recommend_tab li"); 3458 mainRecommend_tab.on('click', function(){ 3459 $(this).addClass('on').siblings().removeClass('on'); 3460 3461 var recommendNum = $(this).index(); 3462 recommend(recommendNum) 3463 3464 return false 3465 }); 3466 3467 function recommend(recommendNum) { 3468 recommendNum = parseInt(recommendNum) + 1; 3469 $('.main-recommend .ec-base-product').addClass('hiding'); 3470 3471 $('.main-recommend #recommend_prod' + recommendNum).removeClass('hiding'); 3472 mainRecommend.slick('unslick'); 3473 mainRecommend.slick({ 3474 slidesToShow: 1, 3475 arrows: true 3476 }) 3477 } 3478 3479 3480 3481 // ìê° ë§í¬ ë¯¸ë ¸ì¶ 3482 function golink(num) { 3483 var prop = $('.description ul li').eq(num).find('span'); 3484 var item_content = $('.description ul li').eq(num).find('span').text(); 3485 var name = item_content.split('|')[0]; 3486 3487 prop.text(name); 3488 } 3489 3490 $('.description ul li').each(function(i,v){ 3491 $(v).find('span').text().trim().includes('http') && golink(i); 3492 }) 3493 3494 3495}); 3496/** ì¤ì°ì´_JS 210806 **/ 3497jQuery(document).ready(function () { 3498 3499 /* ë©ì¸ ìí ì¬ë¼ì´ë */ 3500 var special_slide = new Swiper('.special_slide', { 3501 slidesPerView: 'auto', 3502 spaceBetween: 20, 3503 observer: true, 3504 observeParents: true, 3505 speed: 700, 3506 watchOverflow: 'true', 3507 preloadImages: false, 3508 lazy : { 3509 loadPrevNext : true, 3510 }, 3511 scrollbar: { 3512 el: ".swiper-scrollbar", 3513 hide: false, 3514 draggable: true, 3515 }, 3516 navigation: { 3517 nextEl: '.swiper-button-next-special_slide', 3518 prevEl: '.swiper-button-prev-special_slide', 3519 }, 3520 autoplay: { 3521 delay: 5000, 3522 disableOnInteraction: false, 3523 }, 3524 breakpoints: { 3525 768: { 3526 slidesPerView: 'auto', 3527 spaceBetween: 10, 3528 }, 3529 } 3530 }); 3531 3532 /* ë©ì¸ íì¹´í ê³ ë¦¬ */ 3533 jQuery(".main_product_tab li").bind("click", function () { 3534 jQuery(this).parent().find('li button').removeClass("active"); 3535 jQuery(this).parents('.main_product_category').find('.content_list .tabcontent').removeClass("active"); 3536 jQuery('button', this).addClass("active"); 3537 var activeTab = jQuery('button', this).attr("data-id"); 3538 jQuery(this).parents('.main_product_category').find('.content_list .tabcontent' + '#' + activeTab).addClass("active"); 3539 }); 3540 jQuery('.main_product_category .main_product_inner .main_product_tab li button, .content_list .tabcontent').removeClass('active'); // ëë¨¸ì§ í ì¨ê¹ 3541 jQuery('.main_product_category .main_product_inner .main_product_tab li:first-child button, .content_list .tabcontent:first-child').addClass('active'); // 첫ë²ì§¸ í ì¤í 3542 3543 /* ë©ì¸ í ì¤í¸ë°°ë ë§í¬ ììì ìììì */ 3544 jQuery(".main_text_link").each(function () { 3545 var text_none = jQuery('a', this).text(); 3546 if (text_none == '') { 3547 jQuery(this).hide(); 3548 } 3549 }); 3550 3551 EZST.register('image-gallery/2', function () { 3552 return { 3553 connect: connect, 3554 change: change, 3555 }; 3556 3557 /** 3558 * ì¹ì ì´ ì¶ê°ëë ê²½ì° / íì´ì§ë¡ë©ì ê²ìëë ì¹ì ë ê°ë ì ì¶ê°ë¡ ê°ì£¼ 3559 * @param {HTMLElement} section ì¹ì ìµìì ìì 3560 * @param {string} type íì 3561 * @returns void 3562 */ 3563 function connect(section, type) { 3564 _reset(section, type); 3565 } 3566 3567 /** 3568 * ì¹ì ì¤ì ë³ê²½ íì ì¶ê° ëë ìì ë±ì ë³ê²½ì¬íì´ ì긴 ê²½ì° 3569 * @param {HTMLElement} section ì¹ì ìµìì ìì 3570 * @param {string} type íì 3571 * @returns void 3572 */ 3573 function change(section, type) { 3574 _reset(section, type); 3575 } 3576 3577 /** 3578 * ê° ì¹ì ìµìì ìì(.section)를 기ì¤ì¼ë¡ 기ë¥ì ì¬ ì´ê¸°í í©ëë¤. 3579 * @param {HTMLElement} section ì¹ì ìµìì ìì 3580 * @param {string} type íì 3581 * @returns void 3582 */ 3583 function _reset(section, type) { 3584 // ì¹ì ì´ê¸°í ì²ë¦¬ 3585 /* ë©ì¸ í ì¤í¸ê°¤ë¬ë¦¬ë°°ë ë ¸ì¶ì¤ì ë³´ë¤ ë°°ëê° ì ìë ì¤ìì ë ¬ */ 3586 jQuery(section).find(".main_3dan_banner ul").each(function () {
3587 var grid_num = parseInt(jQuery(section).find("[data-ez-column]").attr('data-ez-column'), 10); //ì¤ì í ë ¸ì¶ê°ì 3588 var li_num = parseInt(jQuery(section).attr('data-ez-item-length'), 10); //ë±ë¡ë ìì´í ê°ì 3589 3590 if (!document.documentElement.classList.contains('ez-view-type-mobile') && grid_num > li_num) { // 모ë°ì¼ì¼ë 3591 jQuery(this).css('justify-content', 'center'); 3592 jQuery('li', this).css('flex', '1'); 3593 } else { 3594 jQuery(this).css('justify-content', ''); 3595 jQuery('li', this).css('flex', ''); 3596 } 3597 3598 if (grid_num == '4') { // ì¤ì í ë ¸ì¶ ê°ìê° 4ê°ì¼ë 3599 if (li_num >= grid_num) { // ë±ë¡í ìì´í ê°ìê° ë ¸ì¶ê°ìë³´ë¤ ë§ìë 3600 jQuery(this).addClass("fs_medium"); 3601 } 3602 } 3603 3604 if (grid_num == '5') { // ì¤ì í ë ¸ì¶ ê°ìê° 5ê°ì¼ë 3605 if (li_num >= grid_num) { // ë±ë¡í ìì´í ê°ìê° ë ¸ì¶ê°ìë³´ë¤ ë§ìë 3606 jQuery(this).addClass("fs_small"); 3607 } else if(li_num == '4') { 3608 jQuery(this).addClass("fs_medium"); 3609 } 3610 } 3611 3612 if (li_num < '4') { // ë°°ëê° 4ê° ë¯¸ë§ì´ë©´ ë보기 ë²í¼ ì¨ê¹ 3613 jQuery(this).parent('.main_3dan_banner').find('.main_image_text_gallery_more').hide(); 3614 } 3615 if (li_num == '1') { // ë°°ëê° 1ì¥ì¼ë 3616 jQuery('li a picture img', this).css('width', '100%'); 3617 jQuery('li', this).css('width', '100%'); 3618 } 3619 }); 3620 /* ë©ì¸ í ì¤í¸ê°¤ë¬ë¦¬ë°°ë ë보기 */ 3621 jQuery(section).find(".main_image_text_gallery_more_btn").on("click", function (event) { 3622 jQuery(section).find('ul li').show().animate({ opacity: 1 }); 3623 jQuery(this).parent().hide(); 3624 }) 3625 } 3626 }); 3627}); 3628 3629 3630//window popup script 3631function winPop(url) { 3632 window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no"); 3633} 3634/** 3635 * document.location.href split 3636 * return array Param 3637 */ 3638function getQueryString(sKey) 3639{ 3640 var sQueryString = document.location.search.substring(1); 3641 var aParam = {}; 3642 3643 if (sQueryString) { 3644 var aFields = sQueryString.split("&"); 3645 var aField = []; 3646 for(var i=0; i<aFields.length; i++){ 3647 aField = aFields[i].split('='); 3648 aParam[aField[0]] = aField[1]; 3649 } 3650 } 3651 3652 aParam.page = aParam.page ? aParam.page : 1; 3653 return sKey ? aParam[sKey] : aParam; 3654}; 3655 3656/** 3657 * 구매ë²í¼ 3658*/ 3659var globalBuyBtnScrollFunc = function() { 3660 // 구매ë²í¼ ê´ë ¨ë³ì 3661 var sFixId = $('#orderFixItem').length > 0 ? 'orderFixItem' : 'fixedActionButton', 3662 $area = $('#orderFixArea'), 3663 $item = $('#' + sFixId + '').not($area); 3664 3665 $(window).scroll(function(){ 3666 try { 3667 // 구매ë²í¼ ê´ë ¨ë³ì 3668 var iCurrentHeightPos = $(this).scrollTop() + $(this).height(), 3669 iButtonHeightPos = $item.offset().top; 3670 3671 if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) { 3672 if (iButtonHeightPos < $(this).scrollTop() - $item.height()) { 3673 $area.fadeIn('fast'); 3674 } else { 3675 $area.hide(); 3676 } 3677 } else { 3678 $area.fadeIn('fast'); 3679 } 3680 } catch(e) { } 3681 }); 3682}; 3683 3684$(function(){ 3685 // tab 3686 $.eTab = function(ul) { 3687 $(ul).find('a').on('click', function() { 3688 var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'), 3689 _target = $(this).attr('href'), 3690 _siblings = '.' + $(_target).attr('class'); 3691 $(_target).show().siblings(_siblings).hide(); 3692 return false 3693 }); 3694 } 3695 if ( window.call_eTab ) { 3696 call_eTab(); 3697 }; 3698 globalBuyBtnScrollFunc(); 3699}); 3700(function($){ 3701 $.fn.extend({ 3702 center: function() { 3703 this.each(function() { 3704 var 3705 $this = $(this), 3706 $w = $(window); 3707 $this.css({ 3708 position: "absolute", 3709 top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px", 3710 left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px" 3711 }); 3712 }); 3713 return this; 3714 } 3715 });
3716 $(function() { 3717 var $container = function(){/* 3718 <div id="modalContainer"> 3719 <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe> 3720 </div>'); 3721 */}.toString().slice(14,-3); 3722 $('body') 3723 .append($('<div id="modalBackpanel"></div>')) 3724 .append($($container)); 3725 function closeModal () { 3726 $('#modalContainer').hide(); 3727 $('#modalBackpanel').hide(); 3728 } 3729 $('#modalBackpanel').on('click',closeModal); 3730 zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) { 3731 var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup; 3732 $('#modalContent').attr('src', $url); 3733 $('#modalContent').on("load",function(){ 3734 $(".header .close",this.contentWindow.document.body).on("click", closeModal); 3735 }); 3736 $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show(); 3737 $('#modalContainer').center().show(); 3738 } 3739 }); 3740})(jQuery); 3741/** 3742 * ìì§ì´ë ë°°ë Jquery Plug-in 3743 * @author cafe24 3744 */ 3745 3746(function($){ 3747 3748 $.fn.floatBanner = function(options) { 3749 options = $.extend({}, $.fn.floatBanner.defaults , options); 3750 3751 return this.each(function() { 3752 var aPosition = $(this).position(); 3753 var jbOffset = $(this).offset(); 3754 var node = this; 3755 3756 $(window).on('scroll', function() { 3757 var _top = $(document).scrollTop(); 3758 _top = (aPosition.top < _top) ? _top : aPosition.top; 3759 3760 setTimeout(function () { 3761 var newinit = $(document).scrollTop(); 3762 3763 if ( newinit > jbOffset.top ) { 3764 _top -= jbOffset.top; 3765 var container_height = $("#wrap").height(); 3766 var quick_height = $(node).height(); 3767 var cul = container_height - quick_height; 3768 if(_top > cul){ 3769 _top = cul; 3770 } 3771 } else { 3772 _top = 0; 3773 } 3774 3775 $(node).stop().animate({top: _top}, options.animate); 3776 }, options.delay); 3777 }); 3778 }); 3779 }; 3780 3781 $.fn.floatBanner.defaults = { 3782 'animate' : 500, 3783 'delay' : 500 3784 }; 3785 3786})(jQuery); 3787 3788/** 3789 * 문ì 구ëí ìì 3790 */ 3791$(function(){ 3792 $('#banner:visible, #quick:visible').floatBanner(); 3793 3794 //placeholder 3795 $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){ 3796 var placeholderName = $(this).parents().attr('title'); 3797 $(this).attr("placeholder", placeholderName); 3798 }); 3799 /* placeholder ie8, ie9 */ 3800 $.fn.extend({ 3801 placeholder : function() { 3802 //IE 8 ë²ì ìë hasPlaceholderSupport() ê°ì´ false를 ë¦¬í´ 3803 if (hasPlaceholderSupport() === true) { 3804 return this; 3805 } 3806 //hasPlaceholderSupport() ê°ì´ false ì¼ ê²½ì° ìë ì½ë를 ì¤í 3807 return this.each(function(){ 3808 var findThis = $(this); 3809 var sPlaceholder = findThis.attr('placeholder'); 3810 if ( ! sPlaceholder) { 3811 return; 3812 } 3813 findThis.wrap('<label class="ePlaceholder" />'); 3814 var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : ''; 3815 findThis.before('<span' + sDisplayPlaceHolder + '>' + sPlaceholder + '</span>'); 3816 this.onpropertychange = function(e){ 3817 e = event || e; 3818 if (e.propertyName == 'value') { 3819 $(this).trigger('focusout'); 3820 } 3821 }; 3822 //ê³µíµ class 3823 var agent = navigator.userAgent.toLowerCase(); 3824 if (agent.indexOf("msie") != -1) { 3825 $(".ePlaceholder").css({"position":"relative"}); 3826 $(".ePlaceholder span").css({"position":"absolute", "padding":"0 4px", "color":"#878787"}); 3827 $(".ePlaceholder label").css({"padding":"0"}); 3828 } 3829 }); 3830 } 3831 }); 3832 3833 $(':input[placeholder]').placeholder(); //placeholder() í¨ì를 í¸ì¶ 3834 3835 //í´ë¦íë©´ placeholder ì¨ê¹ 3836 $('body').on('click', '.ePlaceholder span', function(){ 3837 $(this).hide(); 3838 }); 3839 3840 //inputì°½ í¬ì»¤ì¤ ì¸ ì¼ë placeholder ì¨ê¹ 3841 $('body').on('focusin', '.ePlaceholder :input', function(){ 3842 $(this).prev('span').hide(); 3843 }); 3844 3845 //inputì°½ í¬ì»¤ì¤ ìì ì¼ë value ê° true ì´ë©´ ì¨ê¹, false ì´ë©´ ë³´ì¬ì§ 3846 $('body').on('focusout', '.ePlaceholder :input', function(){ 3847 if (this.value) { 3848 $(this).prev('span').hide(); 3849 } else { 3850 $(this).prev('span').show(); 3851 } 3852 }); 3853 3854 //inputì placeholderê° ì§ìì´ ëë©´ true를 ìëë©´ false를 리í´ê°ì¼ë¡ ëì ¸ì¤ 3855 function hasPlaceholderSupport() { 3856 if ('placeholder' in document.createElement('input')) { 3857 return true; 3858 } else { 3859 return false;
3860 } 3861 } 3862}); 3863 3864/** 3865 * ì¸ë¤ì¼ ì´ë¯¸ì§ ìë°ì¼ê²½ì° ê¸°ë³¸ê° ì¤ì 3866 */ 3867$(window).on('load', function() { 3868 $("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){ 3869 var $img = new Image(); 3870 $img.onerror = function () { 3871 $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif"; 3872 } 3873 $img.src = this.src; 3874 }); 3875}); 3876 3877/** 3878 * tooltip 3879 */ 3880$('.eTooltip').each(function(i){ 3881 $(this).find('.btnClose').attr('tabIndex','-1'); 3882}); 3883//tooltip input focus 3884$('.eTooltip').find('input').on('focus', function() { 3885 var targetName = returnTagetName(this); 3886 targetName.siblings('.ec-base-tooltip').show(); 3887}); 3888$('.eTooltip').find('input').on('focusout', function() { 3889 var targetName = returnTagetName(this); 3890 targetName.siblings('.ec-base-tooltip').hide(); 3891}); 3892function returnTagetName(_this){ 3893 var ePlacename = $(_this).parent().attr("class"); 3894 var targetName; 3895 if(ePlacename == "ePlaceholder"){ //ePlaceholder ëì 3896 targetName = $(_this).parents(); 3897 }else{ 3898 targetName = $(_this); 3899 } 3900 return targetName; 3901} 3902 3903/** 3904 * eTab 3905 */ 3906$("body").on("click", ".eTab a", function(e){ 3907 // í´ë¦í li ì selected í´ëì¤ ì¶ê°, 기존 liì ìë selected í´ëì¤ë ìì . 3908 var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"), 3909 _target = $(this).attr("href"), 3910 _siblings = $(_target).attr("class"), 3911 _arr = _siblings.split(" "), 3912 _classSiblings = "."+_arr[0]; 3913 3914 //í´ë¦í íì í´ë¹íë ììë íì±í, 기존 ììë ë¹íì±í í¨. 3915 $(_target).show().siblings(_classSiblings).hide(); 3916 3917 3918 //preventDefault ë a íê·¸ ì²ë¼ í´ë¦ ì´ë²¤í¸ ì¸ì ë³ëì ë¸ë¼ì°ì íëì ë§ê¸° ìí´ ì¬ì©ë¨. 3919 e.preventDefault(); 3920}); 3921 3922/** 3923 * header_banner 3924 */ 3925 3926window.addEventListener('load', function(){ 3927 bottomNav(); 3928 fixedHeader(); 3929 handleNav(); 3930 //quickGoTop(); ì¬ì©ìí¨ 3931 searchLayer(); 3932 //toggleClass('.xans-layout-info.info__customer', '.xans-layout-info.info__customer .toggle', 'selected'); ì¬ì©ìí¨ 3933 //topBanner(); ì¬ì©ìí¨ 3934 handleScroll(); 3935}); 3936 3937function handleScroll(){ 3938 var scrollPosition = 0; 3939 var ticking = false; 3940 var quickMenu = document.querySelector('#quick'); 3941 var scrollY = window.scrollY || window.pageYOffset; 3942 //setQuickScrollEvent(scrollY, quickMenu); ì¬ì©ìí¨ 3943 window.addEventListener('scroll', function(e) { 3944 scrollPosition = window.scrollY || window.pageYOffset; 3945 if (ticking) return; 3946 window.requestAnimationFrame(function() { 3947 fixedHeader() 3948 //setQuickScrollEvent(scrollPosition, quickMenu) ì¬ì©ìí¨ 3949 ticking = false; 3950 }); 3951 ticking = true; 3952 }); 3953} 3954 3955function toggleClass(element, handler, className){ 3956 var _handler = document.querySelector(handler); 3957 var _element = document.querySelector(element); 3958 3959 _handler.addEventListener('click', function(){ 3960 if ( _element.classList.contains(className) ) { 3961 _element.classList.remove( className ); 3962 } else { 3963 _element.classList.add( className ); 3964 } 3965 }); 3966} 3967 3968function fixedHeader() { 3969 var header = document.getElementById("header"); 3970 var fixed_margin = document.getElementById("contents"); 3971 var scrollY = window.pageYOffset || document.documentElement.scrollTop; 3972 var header_height = document.getElementById("header").scrollHeight+'px'; 3973 3974 if(scrollY > header.offsetTop) { 3975 header.classList.add("fixed"); 3976 fixed_margin.style.marginTop = header_height; 3977 } else { 3978 header.classList.remove("fixed"); 3979 fixed_margin.style.marginTop = '0px'; 3980 } 3981} 3982 3983function handleNav() { 3984 var btnNavs = document.querySelectorAll('.eNavFold'); 3985 var btnClose = document.querySelector('#aside .btnClose'); 3986 var dimmed = document.querySelector('#layoutDimmed'); 3987 var elements = document.getElementsByClassName("test"); 3988 btnNavs.forEach( function(btnNav) { 3989 btnNav.addEventListener('click', function(){ 3990 document.body.classList.add('expand'); 3991 }); 3992 }); 3993 btnClose.addEventListener('click', function(){ 3994 document.body.classList.remove('expand'); 3995 }); 3996 handleDimmed(dimmed, document.body, 'expand'); 3997} 3998 3999 4000function searchLayer() { 4001 var btnSearchs = document.querySelectorAll('.eSearch'); 4002 var btnClose = document.querySelector('.xans-layout-searchheader .btnClose'); 4003 btnSearchs.forEach( function(btnSearch) { 4004 btnSearch.addEventListener('click', function(){ 4005 document.body.classList.add('searchExpand'); 4006 var input = document.querySelector('#keyword'); 4007 //input.focus(); 4008 }); 4009 }); 4010 btnClose.addEventListener('click', function(){ 4011 document.body.classList.remove('searchExpand'); 4012 }); 4013 var dimmed = document.querySelector('#layoutDimmed'); 4014 handleDimmed(dimmed, document.body, 'searchExpand'); 4015} 4016 4017function handleDimmed(target, element, className){ 4018 target.addEventListener('click', function(){ 4019 element.classList.remove(className); 4020 }); 4021} 4022 4023function bottomScroll(){ 4024 var lastScrollTop = 0; 4025 var delta = 5; 4026 var fixBox = document.querySelector('.bottom-nav__top'); 4027 var fixBoxHeight = fixBox.offsetHeight; 4028 var didScroll; 4029 4030 window.onscroll = function(e) { 4031 didScroll = true; 4032 }; 4033 4034 setInterval(function(){ 4035 if(didScroll){ 4036 hasScrolled(); 4037 didScroll = false;
4038 } 4039 }, 250); 4040 4041 function hasScrolled(){ 4042 var nowScrollTop = window.scrollY; 4043 if(Math.abs(lastScrollTop - nowScrollTop) <= delta){ 4044 return; 4045 } 4046 if(nowScrollTop > lastScrollTop && nowScrollTop > fixBoxHeight){ 4047 //Scroll down 4048 var scrollTop = window.scrollTop(); 4049 var innerHeight = window.innerHeight(); 4050 var scrollHeight = $('body').prop('scrollHeight'); 4051 if (scrollTop + innerHeight >= scrollHeight) { 4052 fixBox.classList.add('bottom-nav--hide'); 4053 return true; 4054 } 4055 }else{ 4056 if(nowScrollTop + window.innerHeight < document.body.offsetHeight){ 4057 //Scroll up 4058 fixBox.classList.remove('bottom-nav--hide'); 4059 } 4060 } 4061 lastScrollTop = nowScrollTop; 4062 } 4063} 4064 4065function bottomNav(){ 4066 var lastScrollTop = 0; 4067 var btnTop = document.querySelector('.bottom-nav__top'); 4068 var fixedButton = document.getElementById("orderFixArea"); 4069 if(fixedButton){ 4070 document.body.classList.add("button--fixed"); 4071 }; 4072 4073 window.addEventListener("scroll", function(){ 4074 var scroll = window.pageYOffset || document.documentElement.scrollTop; 4075 var nav = document.querySelector('.bottom-nav'); 4076 if (scroll > lastScrollTop){ 4077 nav.classList.add('bottom-nav--hide'); 4078 } else { 4079 nav.classList.remove('bottom-nav--hide'); 4080 } 4081 // scroll bottom 4082 if(scroll === document.body.scrollHeight - document.documentElement.offsetHeight){ 4083 nav.classList.remove('bottom-nav--hide'); 4084 } 4085 lastScrollTop = scroll <= 0 ? 0 : scroll; 4086 4087 // top button 4088 var currentScrollPercentage = getCurrentScrollPercentage(); 4089 if(currentScrollPercentage > 30){ 4090 btnTop.classList.add('bottom-nav__top--show'); 4091 } else { 4092 btnTop.classList.remove('bottom-nav__top--show'); 4093 } 4094 }); 4095 4096 btnTop.addEventListener('click', function(){ 4097 window.scrollTo({ 4098 top: 0, 4099 behavior: 'smooth' 4100 }); 4101 }); 4102} 4103 4104function getOffset(element){ 4105 if (!element.getClientRects().length) 4106 { 4107 return { top: 0, left: 0 }; 4108 } 4109 4110 var rect = element.getBoundingClientRect(); 4111 var win = element.ownerDocument.defaultView; 4112 return ( 4113 { 4114 top: rect.top + win.pageYOffset, 4115 left: rect.left + win.pageXOffset 4116 }); 4117} 4118 4119function getQuickPosition(){ 4120 var role = document.querySelector("meta[name='path_role']").getAttribute('content'); 4121 if (role === "MAIN") { 4122 return getMainQuickPosition(); 4123 } else { 4124 return getSubQuickPosition(); 4125 } 4126} 4127 4128function getMainQuickPosition(){ 4129 var quickMenu = document.querySelector('#quick'); 4130 var collection = document.querySelector('.collection'); 4131 var snsItem = document.querySelector('.snsItem'); 4132 4133 var mainTopSpace = 115; 4134 var mainFooterSpace = 34; 4135 4136 var top = collection.offsetTop + collection.clientHeight + mainTopSpace; 4137 var footTop = getOffset(snsItem).top + mainFooterSpace; 4138 var maxY = footTop - quickMenu.offsetHeight; 4139 4140 return [top, maxY] 4141} 4142 4143function getSubQuickPosition(){ 4144 var quickMenu = document.querySelector('#quick'); 4145 var footer = document.querySelector("#footer"); 4146 4147 var footerSpace = 60; 4148 var top = 284; 4149 var footTop = getOffset(footer).top; 4150 var maxY = footTop - quickMenu.offsetHeight - footerSpace; 4151 4152 return [top, maxY] 4153} 4154 4155function setQuickScrollEvent(y, quick){ 4156 var header = document.querySelector('#header'); 4157 var position = getQuickPosition(); 4158 var scrollY = y; 4159 if (scrollY >= position[0] - header.offsetHeight){ 4160 if (scrollY < position[1]) { 4161 quick.classList.add('fixed'); 4162 quick.removeAttribute('style'); 4163 } else { 4164 quick.classList.remove('fixed'); 4165 quick.style.position = 'absolute'; 4166 quick.style.top = position[1] + 'px'; 4167 } 4168 } else { 4169 quick.style.top = position[0] + 'px'; 4170 quick.classList.remove('fixed'); 4171 } 4172} 4173 4174function quickGoTop(){ 4175 var btnTop = document.querySelector('#quick .pageTop'); 4176 btnTop.addEventListener('click', function(){ 4177 window.scrollTo({ 4178 top: 0, 4179 behavior: 'smooth' 4180 }); 4181 }); 4182} 4183
4184function topBanner(){ 4185 var banner = document.querySelector('#topBanner'); 4186 if(!banner) return; 4187 var btnClose = banner.querySelector('.btnClose'); 4188 btnClose.addEventListener('click', function(){ 4189 banner.classList.add("hidden"); 4190 }); 4191} 4192 4193 4194function getCurrentScrollPercentage(){ 4195 return (window.scrollY + window.innerHeight) / document.body.clientHeight * 100 4196} 4197 4198 4199jQuery(document).ready(function() { 4200 4201 /* ì¹´í ê³ ë¦¬ê° ëëì¼ë ëë¨¸ì§ ì¨ê¹ 4202 jQuery("#header .inner .top_nav_box .top_category").each(function(){ 4203 var top_category_length = jQuery(' > ul > li',this).length; 4204 if ( top_category_length > 20 ) { 4205 jQuery(this).append('<div class="cate_more"></div>'); 4206 } 4207 jQuery(' > ul > li:lt(20)',this).show(); 4208 }); */ 4209 4210 /* ì¹´í ê³ ë¦¬ê° ëëì¼ë ì´ìì¼ë ì¶ë ¥ë²í¼ 4211 jQuery("#header .inner .top_nav_box .top_category .cate_more").click(function() { 4212 var cate_more_on = jQuery(this).hasClass('on'); 4213 if ( cate_more_on == false ) { 4214 jQuery('#header .inner .top_nav_box .top_category > ul > li').show(); 4215 jQuery('#header .inner .top_nav_box .top_category .cate_more').addClass("on"); 4216 } else { 4217 jQuery('#header .inner .top_nav_box .top_category .cate_more').removeClass("on"); 4218 jQuery('#header .inner .top_nav_box .top_category > ul > li').hide(); 4219 jQuery('#header .inner .top_nav_box .top_category > ul > li:lt(20)').show(); 4220 } 4221 }); */ 4222 4223 /* ìµìë¨ë°°ë í루ëì ë«ê¸° - */ 4224 jQuery(".main_top_banner .top_banner_box_inner .top_banner_close .icon").bind("click", function() { 4225 if(jQuery("#top_banner_box_cloase").is(":checked")){ 4226 jQuery(".main_top_banner").slideUp("fast"); 4227 setCookiem("top_banner_cookie", "top_banner_cookie", 1); 4228 } else { 4229 jQuery(".main_top_banner").slideUp("fast"); 4230 } 4231 }); 4232 var main_top_banner_diplay = jQuery(".main_top_banner").attr("data-ez-display"); 4233 if (!getCookiem("top_banner_cookie") && (main_top_banner_diplay == 'visible')) { 4234 jQuery(".main_top_banner").slideDown("fast"); 4235 } 4236 4237 /* ìµìë¨ë°°ë ë«ê¸°ë²í¼ ììì ëì´ ìì */ 4238 if(jQuery(".top_banner_close").css("display") == "none"){ 4239 jQuery(".main_top_banner").addClass('close_none'); 4240 if (main_top_banner_diplay == 'visible') { 4241 jQuery(".main_top_banner").slideDown("fast"); 4242 } 4243 } 4244 4245 /* ìë¨ ê³ ê°ì¼í° - */ 4246 jQuery("#header .inner .toparea .toparea_state .toparea_state_board").click(function() { 4247 var theme_cl = jQuery(this).attr('class'); 4248 jQuery(this).toggleClass('on'); 4249 }); 4250 4251 /* ë¡ê·¸ì¸í¼ placeholder ì¶ê° - */ 4252 if (jQuery('.xans-member-login').val() != undefined) { 4253 jQuery('#member_passwd').attr('placeholder', 'ë¹ë°ë²í¸'); 4254 } 4255 4256 /* ë¹íì 주문조ííì´ì§ placeholder ì¶ê° - */ 4257 setTimeout(function(){ 4258 if (jQuery('.xans-myshop-orderhistorynologin').val() != undefined) { 4259 jQuery('#order_name').attr('placeholder', '주문ìëª '); 4260 jQuery('#order_id').attr('placeholder', '주문ë²í¸(íì´í(-) í¬í¨)'); 4261 jQuery('#order_password').attr('placeholder', 'ë¹íì주문 ë¹ë°ë²í¸'); 4262 } 4263 }, 100); 4264 4265 /* ê²ìíì´ì§ ì¸íë°ì¤ìì í ì¤í¸ ìì - */ 4266 jQuery('#ec-product-searchdata-searchkeyword_form').find('button.btnDelete').bind('click', function() { 4267 jQuery('#ec-product-searchdata-keyword').val('').focus(); 4268 }); 4269 4270 /* ê²ìíì´ì§ ì ë ¬ í ì¤í¸ ë³ê²½ */ 4271 jQuery("#order_by").each(function(){ 4272 jQuery('option:first-child', this).text('- ì ë ¬ë°©ì -'); 4273 }); 4274 4275 /* ë©í°ìµ ììê²½ì° ì¨ê¹ */ 4276 jQuery(".xans-layout-multishoplist").each(function(){ 4277 var multishoplist_count = jQuery('li', this).length; 4278 if ( multishoplist_count == 1 ) { 4279 jQuery(this).hide(); 4280 } 4281 }); 4282 4283 /* íë¨ ìì¤í¬ë¡ ì¬ì©íë©´ ì¶ë ¥ */ 4284 jQuery("#footer .inner .bt_escrow").each(function(){ 4285 var bt_escrow = jQuery(this).attr("data-ez-escrow"); 4286 if ( !bt_escrow == '' ) { 4287 var bt_escrow_name = jQuery("a img[data-ez-escrow-id="+ bt_escrow +"]", this).addClass('on'); 4288 jQuery(this).css('display','flex'); 4289 } 4290 }); 4291 4292 /* ë¡ê·¸ì¸íì´ì§ SNS ì¬ì©íë©´ ì¶ë ¥ */ 4293 jQuery(".xans-member-login .login__sns .wrap_sns_log a").each(function(){ 4294 var wrap_sns_log = jQuery(this).hasClass('displaynone'); 4295 if( wrap_sns_log == false){ 4296 jQuery(".xans-member-login .login__sns").css('display','block'); 4297 } 4298 }); 4299 4300 /* 기íì ë ì´ììë³ê²½ì ë°ë¥¸ íê²ê³ ì ìì¹ ë³ê²½ */ 4301 var header_height = document.getElementById("header").scrollHeight; 4302 jQuery('.xans-project-list h3 span').css('top',-header_height+30); 4303 4304 /* 모ë°ì¼ìì ì¼ííë ì´ì */ 4305 jQuery('#shoppQbtn').click(function(){ 4306 if (jQuery("#searchContent.xans-product-searchdata").is(":hidden")) { 4307 jQuery('#searchContent.xans-product-searchdata').slideDown('normal'); 4308 jQuery(this).text('ìì¸ê²ì ë«ê¸°'); 4309 jQuery(this).css('margin-top','0'); 4310 } else {
4311 jQuery('#searchContent.xans-product-searchdata').slideUp('normal'); 4312 jQuery(this).text('ìì¸ê²ì'); 4313 } 4314 }); 4315 4316 /* 모ë°ì¼ìì ì¼ííë ì´ì ììì ë²í¼ ì¨ê¹ */ 4317 jQuery("#searchContent").each(function(){ 4318 var prdCount_count = jQuery("#ec-searchdata-area", this).length; 4319 if ( prdCount_count == '0' ) { 4320 jQuery('#shoppQbtn').hide(); 4321 } 4322 }); 4323 4324 /* ë§ì´íì´ì§ ëìê²ìê¸ ììë ë©ìì§ íì */ 4325 jQuery(".xans-myshop-boardpackage").each(function(){ 4326 var boardlist = jQuery(".xans-myshop-boardlist table", this).length; 4327 if ( boardlist == '0' ) { 4328 jQuery('.myshop_boardlist_empty').css('display','flex'); 4329 } 4330 }); 4331 4332 /* ë보기 í´ë¦ì */ 4333 jQuery('.btnMore').click(function(){ 4334 setTimeout(function(){ 4335 ifmore(); 4336 },600) 4337 }); 4338 setTimeout(function(){ 4339 ifmore(); 4340 },300) 4341 4342 /* ìë¨ ì¹´í ê³ ë¦¬ ë³ê²½ ê°ì§ */ 4343 top_category(); // ìë¨ì¹´í ê³ ë¦¬ 4344 jQuery('#header .xans-layout-category > ul').on('DOMSubtreeModified', function() { 4345 top_category(); 4346 }); 4347}); 4348 4349/* ìë¨ ì¹´í ê³ ë¦¬ */ 4350function top_category(){ 4351 /* ìë¨ì¹´í ê³ ë¦¬ */ 4352 jQuery('#header .top_category li').mouseenter(function(e) { 4353 var $this = jQuery(this).addClass('on') 4354 }).mouseleave(function(e) { 4355 jQuery(this).removeClass('on'); 4356 }); 4357 4358 /* ìë¨ì¹´í ê³ ë¦¬ ì¤ë¶ë¥ì²´í¬ */ 4359 jQuery('#header .top_category ul.sub_cate01 li').each(function() { 4360 if (jQuery(this).children('ul').length == 0) { 4361 jQuery(this).addClass('noChild'); 4362 } 4363 }); 4364} 4365 4366/* ìµìë¨ë°°ë ì¿ í¤ ì¤í¬ë¦½í¸ - */ 4367function setCookiem(cookie_name, cookie_value, expire_date) { 4368 var today = new Date(); 4369 var expire = new Date(); 4370 expire.setTime(today.getTime() + 3600000 * 24 * expire_date); 4371 cookies = cookie_name + '=' + cookie_value + '; path=/;'; 4372 if (expire_date != 0) cookies += 'expires=' + expire.toGMTString(); 4373 document.cookie = cookies; 4374} 4375 4376function delCookiem(cookie_name) { 4377 var _today = new Date(); 4378 var value = ''; 4379 _today.setDate(_today.getDate() - 1); 4380 document.cookie = cookie_name + "=" + value + '; path=/;' + "; expires=" + _today.toGMTString(); 4381} 4382 4383function getCookiem(name) { 4384 lims = document.cookie; 4385 var index = lims.indexOf(name + "="); 4386 if (index == -1) { 4387 return null; 4388 } 4389 index = lims.indexOf("=", index) + 1; // first character 4390 var endstr = lims.indexOf(';', index); 4391 if (endstr == -1) { 4392 endstr = lims.length; // last character 4393 } 4394 return unescape(lims.substring(index, endstr)); 4395} 4396 4397/* ë보기 í´ë¦ì */ 4398function ifmore(){ 4399 /* ìí ì¸ë¤ì¼ ê´ì¬ìí ì¶ë ¥ & ì¨ê¹ */ 4400 setTimeout(function(){ 4401 jQuery('.ec-base-product .prdList .icon__box .wish').each(function(){ 4402 var isstatus = jQuery(this).children('img').attr('icon_status'); 4403 if ( isstatus == 'on' ) { 4404 jQuery(this).addClass('on'); 4405 } 4406 }); 4407 jQuery('.ec-base-product .prdList .icon__box .wish').click(function(){ 4408 var isstatus = jQuery(this).children('img').attr('icon_status'); 4409 if ( isstatus == 'off' ) { 4410 jQuery(this).addClass('on'); 4411 } else { 4412 jQuery(this).removeClass('on'); 4413 } 4414 }); 4415 },200) 4416 jQuery('.ec-base-product .prdList > li').each(function(){ 4417 /* ìíì§ì´ ì¥ë°êµ¬ë ì¬ì©ìí ì ì¨ê¹ */ 4418 if (jQuery(".icon__box .cart > .ec-admin-icon", this).length == 1) { 4419 } else { 4420 jQuery('.icon__box .cart', this).hide(); 4421 } 4422 /* ìíì§ì´ ìµì 미리보기 ì¬ì©ìí ì ì¨ê¹ */ 4423 if (jQuery(".icon__box .option > a", this).length == 1) { 4424 } else { 4425 jQuery('.icon__box .option', this).hide(); 4426 } 4427 /* ìíì§ì´ ê´ì¬ìí ì¬ì©ìí ì ì¨ê¹ */ 4428 if (jQuery(".icon__box .wish > .ec-product-listwishicon", this).length == 1) { 4429 } else { 4430 jQuery('.icon__box .wish', this).hide(); 4431 } 4432 }); 4433} 4434$(function(){ 4435 if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") { 4436 var sShippingCountryCode4Cookie = 'shippingCountryCode'; 4437 var bShippingCountryProc = false; 4438 4439 // ë°°ì¡êµê° ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 4440 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) { 4441 $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide(); 4442 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide(); 4443 } else { 4444 $('.thumb .xans-layout-multishoplistitem').hide(); 4445 var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)'); 4446 if (typeof(aShippingCountryCode) != 'undefined' && aS
4446hippingCountryCode != null && aShippingCountryCode.length > 2) { 4447 var sShippingCountryValue = aShippingCountryCode[2]; 4448 } 4449 4450 // query stringì¼ë¡ ëì´ ì¨ ë°°ì¡êµê° ê°ì´ ìë¤ë©´, ê·¸ ê°ì ì ì©í¨ 4451 var aHrefCountryValue = decodeURIComponent(location.href).split("/?country="); 4452 4453 if (aHrefCountryValue.length == 2) { 4454 var sShippingCountryValue = aHrefCountryValue[1]; 4455 } 4456 4457 // ë©ì¸ íì´ì§ìì êµê°ì íì ìí ê²½ì°, ê·¸ ì¸ì íì´ì§ìì ì í ë ê°ì´ ì ëì¤ë íì ì²ë¦¬ 4458 if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) { 4459 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 4460 4461 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 4462 $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 4463 } 4464 } 4465 if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) { 4466 sShippingCountryValue = sShippingCountryValue.split("#")[0]; 4467 var bShippingCountryProc = true; 4468 4469 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 4470 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 4471 var expires = new Date(); 4472 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 4473 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 4474 if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) { 4475 $("#f_country").val(sShippingCountryValue).change(); 4476 } 4477 } 4478 } 4479 // ì¸ì´ì í ì¤ì ì´ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 4480 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) { 4481 $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide(); 4482 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide(); 4483 } else { 4484 $('.thumb .xans-layout-multishoplistitem').hide(); 4485 } 4486 4487 // ë°°ì¡êµê° ë° ì¸ì´ ì¤ì ì´ ë ë¤ ì¬ì©ìí¨ì´ë©´ ì¨ê¹ 4488 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) { 4489 $(".xans-layout-multishopshipping").hide(); 4490 $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide(); 4491 } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // ë°°ì¡êµê° ê°ì ì²ë¦¬í ì ì´ ìê³ , ë©ì¸íë©´ì¼ ëë§ ì í ë ì´ì´ë¥¼ ëì 4492 var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(); 4493 $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue); 4494 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join("")); 4495 // ë°°ì¡êµê° ì íì ì¬ì©í´ì¼ ë ì´ì´ë¥¼ ë³´ì´ê² í¨ 4496 if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) { 4497 $(".xans-layout-multishopshipping").show(); 4498 } 4499 } 4500 4501 $(".xans-layout-multishopshipping .close").on("click", function() { 4502 $(".xans-layout-multishopshipping").hide(); 4503 }); 4504 4505 $(".xans-layout-multishopshipping .ec-base-button a").on("click", function() { 4506 var expires = new Date(); 4507 expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30ì¼ê° ì¿ í¤ ì ì§ 4508 document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString(); 4509 4510 // ëë©ì¸ 문ì ë¡ ì¿ í¤ë¡ ë°°ì¡êµê° ì¤ì ì´ ì ëë ê²½ì°ë¥¼ ìí´ query stringì¼ë¡ ë°°ì¡êµê° ê°
4510ì ëê¹ 4511 var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()); 4512 4513 location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting; 4514 }); 4515 $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() { 4516 $(".xans-layout-multishopshipping").show(); 4517 }); 4518 } 4519});
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.