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