1/* 2 _ _ _ _ 3 ___| (_) ___| | __ (_)___ 4/ __| | |/ __| |/ / | / __| 5\__ \ | | (__| < _ | \__ \ 6|___/_|_|\___|_|\_(_)/ |___/ 7 |__/ 8 9 Version: 1.5.5 10 Author: Ken Wheeler 11 Website: http://kenwheeler.github.io 12 Docs: http://kenwheeler.github.io/slick 13 Repo: http://github.com/kenwheeler/slick 14 Issues: http://github.com/kenwheeler/slick/issues 15 16 */ 17/* global window, document, define, jQuery, setInterval, clearInterval */ 18(function(factory) { 19 'use strict'; 20 if (typeof define === 'function' && define.amd) { 21 define(['jquery'], factory); 22 } else if (typeof exports !== 'undefined') { 23 module.exports = factory(require('jquery')); 24 } else { 25 factory(jQuery); 26 } 27 28}(function($) { 29 'use strict'; 30 var Slick = window.Slick || {}; 31 32 Slick = (function() { 33 34 var instanceUid = 0; 35 36 function Slick(element, settings) { 37 38 var _ = this, 39 dataSettings, responsiveSettings, breakpoint; 40 41 _.defaults = { 42 accessibility: true, 43 adaptiveHeight: false, 44 appendArrows: $(element), 45 appendDots: $(element), 46 arrows: true, 47 asNavFor: null, 48 prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="previous">Previous</button>', 49 nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="next">Next</button>', 50 autoplay: false, 51 autoplaySpeed: 3000, 52 centerMode: false, 53 centerPadding: '50px', 54 cssEase: 'ease', 55 customPaging: function(slider, i) { 56 return '<button type="button" data-role="none">' + (i + 1) + '</button>'; 57 }, 58 dots: false, 59 dotsClass: 'slick-dots', 60 draggable: true, 61 easing: 'linear', 62 edgeFriction: 0.35, 63 fade: false, 64 focusOnSelect: false, 65 infinite: true, 66 initialSlide: 0, 67 lazyLoad: 'ondemand', 68 mobileFirst: false, 69 pauseOnHover: true, 70 pauseOnDotsHover: false, 71 respondTo: 'window', 72 responsive: null, 73 rows: 1, 74 rtl: false, 75 slide: '', 76 slidesPerRow: 1, 77 slidesToShow: 1, 78 slidesToScroll: 1, 79 speed: 500, 80 swipe: true, 81 swipeToSlide: false, 82 touchMove: true, 83 touchThreshold: 5, 84 useCSS: true, 85 variableWidth: false, 86 vertical: false, 87 verticalSwiping: false, 88 waitForAnimate: true, 89 zIndex: 1000 90 }; 91 92 _.initials = { 93 animating: false, 94 dragging: false, 95 autoPlayTimer: null, 96 currentDirection: 0, 97 currentLeft: null, 98 currentSlide: 0, 99 direction: 1, 100 $dots: null, 101 listWidth: null, 102 listHeight: null, 103 loadIndex: 0, 104 $nextArrow: null, 105 $prevArrow: null, 106 slideCount: null, 107 slideWidth: null, 108 $slideTrack: null, 109 $slides: null, 110 sliding: false, 111 slideOffset: 0, 112 swipeLeft: null, 113 $list: null, 114 touchObject: {}, 115 transformsEnabled: false, 116 unslicked: false 117 }; 118 119 $.extend(_, _.initials); 120 121 _.activeBreakpoint = null; 122 _.animType = null; 123 _.animProp = null; 124 _.breakpoints = []; 125 _.breakpointSettings = []; 126 _.cssTransitions = false; 127 _.hidden = 'hidden'; 128 _.paused = false; 129 _.positionProp = null; 130 _.respondTo = null; 131 _.rowCount = 1; 132 _.shouldClick = true; 133 _.$slider = $(element); 134 _.$slidesCache = null; 135 _.transformType = null; 136 _.transitionType = null; 137 _.visibilityChange = 'visibilitychange'; 138 _.windowWidth = 0; 139 _.windowTimer = null; 140 141 dataSettings = $(element).data('slick') || {}; 142
vendor: 5,974 bytes, lines 143-316
143 _.options = $.extend({}, _.defaults, dataSettings, settings); 144 145 _.currentSlide = _.options.initialSlide; 146 147 _.originalSettings = _.options; 148 responsiveSettings = _.options.responsive || null; 149 150 if (responsiveSettings && responsiveSettings.length > -1) { 151 _.respondTo = _.options.respondTo || 'window'; 152 for (breakpoint in responsiveSettings) { 153 if (responsiveSettings.hasOwnProperty(breakpoint)) { 154 _.breakpoints.push(responsiveSettings[ 155 breakpoint].breakpoint); 156 _.breakpointSettings[responsiveSettings[ 157 breakpoint].breakpoint] = 158 responsiveSettings[breakpoint].settings; 159 } 160 } 161 _.breakpoints.sort(function(a, b) { 162 if (_.options.mobileFirst === true) { 163 return a - b; 164 } else { 165 return b - a; 166 } 167 }); 168 } 169 170 if (typeof document.mozHidden !== 'undefined') { 171 _.hidden = 'mozHidden'; 172 _.visibilityChange = 'mozvisibilitychange'; 173 } else if (typeof document.webkitHidden !== 'undefined') { 174 _.hidden = 'webkitHidden'; 175 _.visibilityChange = 'webkitvisibilitychange'; 176 } 177 178 _.autoPlay = $.proxy(_.autoPlay, _); 179 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 180 _.changeSlide = $.proxy(_.changeSlide, _); 181 _.clickHandler = $.proxy(_.clickHandler, _); 182 _.selectHandler = $.proxy(_.selectHandler, _); 183 _.setPosition = $.proxy(_.setPosition, _); 184 _.swipeHandler = $.proxy(_.swipeHandler, _); 185 _.dragHandler = $.proxy(_.dragHandler, _); 186 _.keyHandler = $.proxy(_.keyHandler, _); 187 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 188 189 _.instanceUid = instanceUid++; 190 191 // A simple way to check for HTML strings 192 // Strict HTML recognition (must start with <) 193 // Extracted from jQuery v1.11 source 194 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 195 196 _.init(true); 197 198 _.checkResponsive(true); 199 200 } 201 202 return Slick; 203 204 }()); 205 206 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 207 208 var _ = this; 209 210 if (typeof(index) === 'boolean') { 211 addBefore = index; 212 index = null; 213 } else if (index < 0 || (index >= _.slideCount)) { 214 return false; 215 } 216 217 _.unload(); 218 219 if (typeof(index) === 'number') { 220 if (index === 0 && _.$slides.length === 0) { 221 $(markup).appendTo(_.$slideTrack); 222 } else if (addBefore) { 223 $(markup).insertBefore(_.$slides.eq(index)); 224 } else { 225 $(markup).insertAfter(_.$slides.eq(index)); 226 } 227 } else { 228 if (addBefore === true) { 229 $(markup).prependTo(_.$slideTrack); 230 } else { 231 $(markup).appendTo(_.$slideTrack); 232 } 233 } 234 235 _.$slides = _.$slideTrack.children(this.options.slide); 236 237 _.$slideTrack.children(this.options.slide).detach(); 238 239 _.$slideTrack.append(_.$slides); 240 241 _.$slides.each(function(index, element) { 242 $(element).attr('data-slick-index', index); 243 }); 244 245 _.$slidesCache = _.$slides; 246 247 _.reinit(); 248 249 }; 250 251 Slick.prototype.animateHeight = function() { 252 var _ = this; 253 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 254 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 255 _.$list.animate({ 256 height: targetHeight 257 }, _.options.speed); 258 } 259 }; 260 261 Slick.prototype.animateSlide = function(targetLeft, callback) { 262 263 var animProps = {}, 264 _ = this; 265 266 _.animateHeight(); 267 268 if (_.options.rtl === true && _.options.vertical === false) { 269 targetLeft = -targetLeft; 270 } 271 if (_.transformsEnabled === false) { 272 if (_.options.vertical === false) { 273 _.$slideTrack.animate({ 274 left: targetLeft 275 }, _.options.speed, _.options.easing, callback); 276 } else { 277 _.$slideTrack.animate({ 278 top: targetLeft 279 }, _.options.speed, _.options.easing, callback); 280 } 281 282 } else { 283 284 if (_.cssTransitions === false) { 285 if (_.options.rtl === true) { 286 _.currentLeft = -(_.currentLeft); 287 } 288 $({ 289 animStart: _.currentLeft 290 }).animate({ 291 animStart: targetLeft 292 }, { 293 duration: _.options.speed, 294 easing: _.options.easing, 295 step: function(now) { 296 now = Math.ceil(now); 297 if (_.options.vertical === false) { 298 animProps[_.animType] = 'translate(' + 299 now + 'px, 0px)'; 300 _.$slideTrack.css(animProps); 301 } else { 302 animProps[_.animType] = 'translate(0px,' + 303 now + 'px)'; 304 _.$slideTrack.css(animProps); 305 } 306 }, 307 complete: function() { 308 if (callback) { 309 callback.call(); 310 } 311 } 312 }); 313 314 } else { 315 316 _.applyTransition();
317 targetLeft = Math.ceil(targetLeft); 318 319 if (_.options.vertical === false) { 320 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 321 } else { 322 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 323 } 324 _.$slideTrack.css(animProps); 325 326 if (callback) { 327 setTimeout(function() { 328 329 _.disableTransition(); 330 331 callback.call(); 332 }, _.options.speed); 333 } 334 335 } 336 337 } 338 339 }; 340 341 Slick.prototype.asNavFor = function(index) { 342 343 var _ = this, 344 asNavFor = _.options.asNavFor; 345 346 if ( asNavFor && asNavFor !== null ) { 347 asNavFor = $(asNavFor).not(_.$slider); 348 } 349 350 if ( asNavFor !== null && typeof asNavFor === "object" ) { 351 asNavFor.each(function() { 352 var target = $(this).slick('getSlick'); 353 if(!target.unslicked) { 354 target.slideHandler(index, true); 355 } 356 }); 357 } 358 359 }; 360 361 Slick.prototype.applyTransition = function(slide) { 362 363 var _ = this, 364 transition = {}; 365 366 if (_.options.fade === false) { 367 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 368 } else { 369 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 370 } 371 372 if (_.options.fade === false) { 373 _.$slideTrack.css(transition); 374 } else { 375 _.$slides.eq(slide).css(transition); 376 } 377 378 }; 379 380 Slick.prototype.autoPlay = function() { 381 382 var _ = this; 383 384 if (_.autoPlayTimer) { 385 clearInterval(_.autoPlayTimer); 386 } 387 388 if (_.slideCount > _.options.slidesToShow && _.paused !== true) { 389 _.autoPlayTimer = setInterval(_.autoPlayIterator, 390 _.options.autoplaySpeed); 391 } 392 393 }; 394 395 Slick.prototype.autoPlayClear = function() { 396 397 var _ = this; 398 if (_.autoPlayTimer) { 399 clearInterval(_.autoPlayTimer); 400 } 401 402 }; 403 404 Slick.prototype.autoPlayIterator = function() { 405 406 var _ = this; 407 408 if (_.options.infinite === false) { 409 410 if (_.direction === 1) { 411 412 if ((_.currentSlide + 1) === _.slideCount - 413 1) { 414 _.direction = 0; 415 } 416 417 _.slideHandler(_.currentSlide + _.options.slidesToScroll); 418 419 } else { 420 421 if ((_.currentSlide - 1 === 0)) { 422 423 _.direction = 1; 424 425 } 426 427 _.slideHandler(_.currentSlide - _.options.slidesToScroll); 428 429 } 430 431 } else { 432 433 _.slideHandler(_.currentSlide + _.options.slidesToScroll); 434 435 } 436 437 }; 438 439 Slick.prototype.buildArrows = function() { 440 441 var _ = this; 442 443 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 444 445 _.$prevArrow = $(_.options.prevArrow); 446 _.$nextArrow = $(_.options.nextArrow); 447 448 if (_.htmlExpr.test(_.options.prevArrow)) { 449 _.$prevArrow.appendTo(_.options.appendArrows); 450 } 451 452 if (_.htmlExpr.test(_.options.nextArrow)) { 453 _.$nextArrow.appendTo(_.options.appendArrows); 454 } 455 456 if (_.options.infinite !== true) { 457 _.$prevArrow.addClass('slick-disabled'); 458 } 459 460 } 461 462 }; 463 464 Slick.prototype.buildDots = function() { 465 466 var _ = this, 467 i, dotString; 468 469 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 470 471 dotString = '<ul class="' + _.options.dotsClass + '">'; 472 473 for (i = 0; i <= _.getDotCount(); i += 1) { 474 dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>'; 475 } 476 477 dotString += '</ul>'; 478 479 _.$dots = $(dotString).appendTo(
vendor: 14,423 bytes, lines 480-944
480 _.options.appendDots); 481 482 _.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false'); 483 484 } 485 486 }; 487 488 Slick.prototype.buildOut = function() { 489 490 var _ = this; 491 492 _.$slides = _.$slider.children( 493 ':not(.slick-cloned)').addClass( 494 'slick-slide'); 495 _.slideCount = _.$slides.length; 496 497 _.$slides.each(function(index, element) { 498 $(element) 499 .attr('data-slick-index', index) 500 .data('originalStyling', $(element).attr('style') || ''); 501 }); 502 503 _.$slidesCache = _.$slides; 504 505 _.$slider.addClass('slick-slider'); 506 507 _.$slideTrack = (_.slideCount === 0) ? 508 $('<div class="slick-track"/>').appendTo(_.$slider) : 509 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 510 511 _.$list = _.$slideTrack.wrap( 512 '<div aria-live="polite" class="slick-list"/>').parent(); 513 _.$slideTrack.css('opacity', 0); 514 515 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 516 _.options.slidesToScroll = 1; 517 } 518 519 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 520 521 _.setupInfinite(); 522 523 _.buildArrows(); 524 525 _.buildDots(); 526 527 _.updateDots(); 528 529 if (_.options.accessibility === true) { 530 _.$list.prop('tabIndex', 0); 531 } 532 533 _.setSlideClasses(typeof this.currentSlide === 'number' ? this.currentSlide : 0); 534 535 if (_.options.draggable === true) { 536 _.$list.addClass('draggable'); 537 } 538 539 }; 540 541 Slick.prototype.buildRows = function() { 542 543 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; 544 545 newSlides = document.createDocumentFragment(); 546 originalSlides = _.$slider.children(); 547 548 if(_.options.rows > 1) { 549 550 slidesPerSection = _.options.slidesPerRow * _.options.rows; 551 numOfSlides = Math.ceil( 552 originalSlides.length / slidesPerSection 553 ); 554 555 for(a = 0; a < numOfSlides; a++){ 556 var slide = document.createElement('div'); 557 for(b = 0; b < _.options.rows; b++) { 558 var row = document.createElement('div'); 559 for(c = 0; c < _.options.slidesPerRow; c++) { 560 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 561 if (originalSlides.get(target)) { 562 row.appendChild(originalSlides.get(target)); 563 } 564 } 565 slide.appendChild(row); 566 } 567 newSlides.appendChild(slide); 568 } 569 570 _.$slider.html(newSlides); 571 _.$slider.children().children().children() 572 .css({ 573 'width':(100 / _.options.slidesPerRow) + "%", 574 'display': 'inline-block' 575 }); 576 577 } 578 579 }; 580 581 Slick.prototype.checkResponsive = function(initial) { 582 583 var _ = this, 584 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 585 var sliderWidth = _.$slider.width(); 586 var windowWidth = window.innerWidth || $(window).width(); 587 588 if (_.respondTo === 'window') { 589 respondToWidth = windowWidth; 590 } else if (_.respondTo === 'slider') { 591 respondToWidth = sliderWidth; 592 } else if (_.respondTo === 'min') { 593 respondToWidth = Math.min(windowWidth, sliderWidth); 594 } 595 596 if (_.originalSettings.responsive && _.originalSettings 597 .responsive.length > -1 && _.originalSettings.responsive !== null) { 598 599 targetBreakpoint = null; 600 601 for (breakpoint in _.breakpoints) { 602 if (_.breakpoints.hasOwnProperty(breakpoint)) { 603 if (_.originalSettings.mobileFirst === false) { 604 if (respondToWidth < _.breakpoints[breakpoint]) { 605 targetBreakpoint = _.breakpoints[breakpoint]; 606 } 607 } else { 608 if (respondToWidth > _.breakpoints[breakpoint]) { 609 targetBreakpoint = _.breakpoints[breakpoint]; 610 } 611 } 612 } 613 } 614 615 if (targetBreakpoint !== null) { 616 if (_.activeBreakpoint !== null) { 617 if (targetBreakpoint !== _.activeBreakpoint) { 618 _.activeBreakpoint = 619 targetBreakpoint; 620 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 621 _.unslick(targetBreakpoint); 622 } else { 623 _.options = $.extend({}, _.originalSettings, 624 _.breakpointSettings[ 625 targetBreakpoint]); 626 if (initial === true) { 627 _.currentSlide = _.options.initialSlide; 628 } 629 _.refresh(initial); 630 } 631 triggerBreakpoint = targetBreakpoint; 632 } 633 } else { 634 _.activeBreakpoint = targetBreakpoint; 635 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 636 _.unslick(targetBreakpoint); 637 } else { 638 _.options = $.extend({}, _.originalSettings, 639 _.breakpointSettings[ 640 targetBreakpoint]); 641 if (initial === true) { 642 _.currentSlide = _.options.initialSlide; 643 } 644 _.refresh(initial); 645 } 646 triggerBreakpoint = targetBreakpoint; 647 } 648 } else { 649 if (_.activeBreakpoint !== null) { 650 _.activeBreakpoint = null; 651 _.options = _.originalSettings; 652 if (initial === true) { 653 _.currentSlide = _.options.initialSlide; 654 } 655 _.refresh(initial); 656 triggerBreakpoint = targetBreakpoint; 657 } 658 } 659 660 // only trigger breakpoints during an actual break. not on initialize. 661 if( !initial && triggerBreakpoint !== false ) { 662 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 663 } 664 } 665 666 }; 667 668 Slick.prototype.changeSlide = function(event, dontAnimate) { 669 670 var _ = this, 671 $target = $(event.target), 672 indexOffset, slideOffset, unevenOffset; 673 674 // If target is a link, prevent default action. 675 if($target.is('a')) { 676 event.preventDefault(); 677 } 678 679 // If target is not the <li> element (ie: a child), find the <li>. 680 if(!$target.is('li')) { 681 $target = $target.closest('li'); 682 } 683 684 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 685 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 686 687 switch (event.data.message) { 688 689 case 'previous': 690 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 691 if (_.slideCount > _.options.slidesToShow) { 692 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 693 } 694 break; 695 696 case 'next': 697 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 698 if (_.slideCount > _.options.slidesToShow) { 699 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 700 } 701 break; 702 703 case 'index': 704 var index = event.data.index === 0 ? 0 : 705 event.data.index || $target.index() * _.options.slidesToScroll; 706 707 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 708 $target.children().trigger("focus"); 709 break; 710 711 default: 712 return; 713 } 714 715 }; 716 717 Slick.prototype.checkNavigable = function(index) { 718 719 var _ = this, 720 navigables, prevNavigable; 721 722 navigables = _.getNavigableIndexes(); 723 prevNavigable = 0; 724 if (index > navigables[navigables.length - 1]) { 725 index = navigables[navigables.length - 1]; 726 } else { 727 for (var n in navigables) { 728 if (index < navigables[n]) { 729 index = prevNavigable; 730 break; 731 } 732 prevNavigable = navigables[n]; 733 } 734 } 735 736 return index; 737 }; 738 739 Slick.prototype.cleanUpEvents = function() { 740 741 var _ = this; 742 743 if (_.options.dots && _.$dots !== null) { 744 745 $('li', _.$dots).off('click.slick', _.changeSlide); 746 747 if (_.options.pauseOnDotsHover === true && _.options.autoplay === true) { 748 749 $('li', _.$dots) 750 .off('mouseenter.slick', $.proxy(_.setPaused, _, true)) 751 .off('mouseleave.slick', $.proxy(_.setPaused, _, false)); 752 753 } 754 755 } 756 757 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 758 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 759 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 760 } 761 762 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 763 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 764 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 765 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 766 767 _.$list.off('click.slick', _.clickHandler); 768 769 $(document).off(_.visibilityChange, _.visibility); 770 771 _.$list.off('mouseenter.slick', $.proxy(_.setPaused, _, true)); 772 _.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false)); 773 774 if (_.options.accessibility === true) { 775 _.$list.off('keydown.slick', _.keyHandler); 776 } 777 778 if (_.options.focusOnSelect === true) { 779 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 780 } 781 782 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 783 784 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 785 786 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 787 788 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 789 $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition); 790 }; 791 792 Slick.prototype.cleanUpRows = function() { 793 794 var _ = this, originalSlides; 795 796 if(_.options.rows > 1) { 797 originalSlides = _.$slides.children().children(); 798 originalSlides.removeAttr('style'); 799 _.$slider.html(originalSlides); 800 } 801 802 }; 803 804 Slick.prototype.clickHandler = function(event) { 805 806 var _ = this; 807 808 if (_.shouldClick === false) { 809 event.stopImmediatePropagation(); 810 event.stopPropagation(); 811 event.preventDefault(); 812 } 813 814 }; 815 816 Slick.prototype.destroy = function(refresh) { 817 818 var _ = this; 819 820 _.autoPlayClear(); 821 822 _.touchObject = {}; 823 824 _.cleanUpEvents(); 825 826 $('.slick-cloned', _.$slider).detach(); 827 828 if (_.$dots) { 829 _.$dots.remove(); 830 } 831 if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) { 832 _.$prevArrow.remove(); 833 } 834 if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) { 835 _.$nextArrow.remove(); 836 } 837 838 if (_.$slides) { 839 840 _.$slides 841 .removeClass('slick-slide slick-active slick-center slick-visible') 842 .removeAttr('aria-hidden') 843 .removeAttr('data-slick-index') 844 .each(function(){ 845 $(this).attr('style', $(this).data('originalStyling')); 846 }); 847 848 _.$slideTrack.children(this.options.slide).detach(); 849 850 _.$slideTrack.detach(); 851 852 _.$list.detach(); 853 854 _.$slider.append(_.$slides); 855 } 856 857 _.cleanUpRows(); 858 859 _.$slider.removeClass('slick-slider'); 860 _.$slider.removeClass('slick-initialized'); 861 862 _.unslicked = true; 863 864 if(!refresh) { 865 _.$slider.trigger('destroy', [_]); 866 } 867 868 }; 869 870 Slick.prototype.disableTransition = function(slide) { 871 872 var _ = this, 873 transition = {}; 874 875 transition[_.transitionType] = ''; 876 877 if (_.options.fade === false) { 878 _.$slideTrack.css(transition); 879 } else { 880 _.$slides.eq(slide).css(transition); 881 } 882 883 }; 884 885 Slick.prototype.fadeSlide = function(slideIndex, callback) { 886 887 var _ = this; 888 889 if (_.cssTransitions === false) { 890 891 _.$slides.eq(slideIndex).css({ 892 zIndex: _.options.zIndex 893 }); 894 895 _.$slides.eq(slideIndex).animate({ 896 opacity: 1 897 }, _.options.speed, _.options.easing, callback); 898 899 } else { 900 901 _.applyTransition(slideIndex); 902 903 _.$slides.eq(slideIndex).css({ 904 opacity: 1, 905 zIndex: _.options.zIndex 906 }); 907 908 if (callback) { 909 setTimeout(function() { 910 911 _.disableTransition(slideIndex); 912 913 callback.call(); 914 }, _.options.speed); 915 } 916 917 } 918 919 }; 920 921 Slick.prototype.fadeSlideOut = function(slideIndex) { 922 923 var _ = this; 924 925 if (_.cssTransitions === false) { 926 927 _.$slides.eq(slideIndex).animate({ 928 opacity: 0, 929 zIndex: _.options.zIndex - 2 930 }, _.options.speed, _.options.easing); 931 932 } else { 933 934 _.applyTransition(slideIndex); 935 936 _.$slides.eq(slideIndex).css({ 937 opacity: 0, 938 zIndex: _.options.zIndex - 2 939 }); 940 941 } 942 943 }; 944
945 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 946 947 var _ = this; 948 949 if (filter !== null) { 950 951 _.unload(); 952 953 _.$slideTrack.children(this.options.slide).detach(); 954 955 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 956 957 _.reinit(); 958 959 } 960 961 }; 962 963 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 964 965 var _ = this; 966 return _.currentSlide; 967 968 }; 969 970 Slick.prototype.getDotCount = function() { 971 972 var _ = this; 973 974 var breakPoint = 0; 975 var counter = 0; 976 var pagerQty = 0; 977 978 if (_.options.infinite === true) { 979 while (breakPoint < _.slideCount) { 980 ++pagerQty; 981 breakPoint = counter + _.options.slidesToShow; 982 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 983 } 984 } else if (_.options.centerMode === true) { 985 pagerQty = _.slideCount; 986 } else { 987 while (breakPoint < _.slideCount) { 988 ++pagerQty; 989 breakPoint = counter + _.options.slidesToShow; 990 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 991 } 992 } 993 994 return pagerQty - 1; 995 996 }; 997 998 Slick.prototype.getLeft = function(slideIndex) { 999 1000 var _ = this, 1001 targetLeft, 1002 verticalHeight, 1003 verticalOffset = 0, 1004 targetSlide; 1005 1006 _.slideOffset = 0; 1007 verticalHeight = _.$slides.first().outerHeight(); 1008 1009 if (_.options.infinite === true) { 1010 if (_.slideCount > _.options.slidesToShow) { 1011 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 1012 verticalOffset = (verticalHeight * _.options.slidesToShow) * -1; 1013 } 1014 if (_.slideCount % _.options.slidesToScroll !== 0) { 1015 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 1016 if (slideIndex > _.slideCount) { 1017 _.slideOffset = ((_.options.slidesToShow - (sl
vendor: 39,974 bytes, lines 1017-2352
1017ideIndex - _.slideCount)) * _.slideWidth) * -1; 1018 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 1019 } else { 1020 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 1021 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 1022 } 1023 } 1024 } 1025 } else { 1026 if (slideIndex + _.options.slidesToShow > _.slideCount) { 1027 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 1028 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 1029 } 1030 } 1031 1032 if (_.slideCount <= _.options.slidesToShow) { 1033 _.slideOffset = 0; 1034 verticalOffset = 0; 1035 } 1036 1037 if (_.options.centerMode === true && _.options.infinite === true) { 1038 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 1039 } else if (_.options.centerMode === true) { 1040 _.slideOffset = 0; 1041 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 1042 } 1043 1044 if (_.options.vertical === false) { 1045 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 1046 } else { 1047 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 1048 } 1049 1050 if (_.options.variableWidth === true) { 1051 1052 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 1053 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 1054 } else { 1055 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 1056 } 1057 1058 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 1059 1060 if (_.options.centerMode === true) { 1061 if (_.options.infinite === false) { 1062 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 1063 } else { 1064 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 1065 } 1066 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 1067 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 1068 } 1069 } 1070 1071 return targetLeft; 1072 1073 }; 1074 1075 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 1076 1077 var _ = this; 1078 1079 return _.options[option]; 1080 1081 }; 1082 1083 Slick.prototype.getNavigableIndexes = function() { 1084 1085 var _ = this, 1086 breakPoint = 0, 1087 counter = 0, 1088 indexes = [], 1089 max; 1090 1091 if (_.options.infinite === false) { 1092 max = _.slideCount; 1093 } else { 1094 breakPoint = _.options.slidesToScroll * -1; 1095 counter = _.options.slidesToScroll * -1; 1096 max = _.slideCount * 2; 1097 } 1098 1099 while (breakPoint < max) { 1100 indexes.push(breakPoint); 1101 breakPoint = counter + _.options.slidesToScroll; 1102 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 1103 } 1104 1105 return indexes; 1106 1107 }; 1108 1109 Slick.prototype.getSlick = function() { 1110 1111 return this; 1112 1113 }; 1114 1115 Slick.prototype.getSlideCount = function() { 1116 1117 var _ = this, 1118 slidesTraversed, swipedSlide, centerOffset; 1119 1120 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 1121 1122 if (_.options.swipeToSlide === true) { 1123 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 1124 if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { 1125 swipedSlide = slide; 1126 return false; 1127 } 1128 }); 1129 1130 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 1131 1132 return slidesTraversed; 1133 1134 } else { 1135 return _.options.slidesToScroll; 1136 } 1137 1138 }; 1139 1140 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 1141 1142 var _ = this; 1143 1144 _.changeSlide({ 1145 data: { 1146 message: 'index', 1147 index: parseInt(slide) 1148 } 1149 }, dontAnimate); 1150 1151 }; 1152 1153 Slick.prototype.init = function(creation) { 1154 1155 var _ = this; 1156 1157 if (!$(_.$slider).hasClass('slick-initialized')) { 1158 1159 $(_.$slider).addClass('slick-initialized'); 1160 1161 _.buildRows(); 1162 _.buildOut(); 1163 _.setProps(); 1164 _.startLoad(); 1165 _.loadSlider(); 1166 _.initializeEvents(); 1167 _.updateArrows(); 1168 _.updateDots(); 1169 1170 } 1171 1172 if (creation) { 1173 _.$slider.trigger('init', [_]); 1174 } 1175 1176 }; 1177 1178 Slick.prototype.initArrowEvents = function() { 1179 1180 var _ = this; 1181 1182 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1183 _.$prevArrow.on('click.slick', { 1184 message: 'previous' 1185 }, _.changeSlide); 1186 _.$nextArrow.on('click.slick', { 1187 message: 'next' 1188 }, _.changeSlide); 1189 } 1190 1191 }; 1192 1193 Slick.prototype.initDotEvents = function() { 1194 1195 var _ = this; 1196 1197 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 1198 $('li', _.$dots).on('click.slick', { 1199 message: 'index' 1200 }, _.changeSlide); 1201 } 1202 1203 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) { 1204 $('li', _.$dots) 1205 .on('mouseenter.slick', $.proxy(_.setPaused, _, true)) 1206 .on('mouseleave.slick', $.proxy(_.setPaused, _, false)); 1207 } 1208 1209 }; 1210 1211 Slick.prototype.initializeEvents = function() { 1212 1213 var _ = this; 1214 1215 _.initArrowEvents(); 1216 1217 _.initDotEvents(); 1218 1219 _.$list.on('touchstart.slick mousedown.slick', { 1220 action: 'start' 1221 }, _.swipeHandler); 1222 _.$list.on('touchmove.slick mousemove.slick', { 1223 action: 'move' 1224 }, _.swipeHandler); 1225 _.$list.on('touchend.slick mouseup.slick', { 1226 action: 'end' 1227 }, _.swipeHandler); 1228 _.$list.on('touchcancel.slick mouseleave.slick', { 1229 action: 'end' 1230 }, _.swipeHandler); 1231 1232 _.$list.on('click.slick', _.clickHandler); 1233 1234 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 1235 1236 _.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true)); 1237 _.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false)); 1238 1239 if (_.options.accessibility === true) { 1240 _.$list.on('keydown.slick', _.keyHandler); 1241 } 1242 1243 if (_.options.focusOnSelect === true) { 1244 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 1245 } 1246 1247 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 1248 1249 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 1250 1251 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 1252 1253 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 1254 $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition); 1255 1256 }; 1257 1258 Slick.prototype.initUI = function() { 1259 1260 var _ = this; 1261 1262 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1263 1264 _.$prevArrow.show(); 1265 _.$nextArrow.show(); 1266 1267 } 1268 1269 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 1270 1271 _.$dots.show(); 1272 1273 } 1274 1275 if (_.options.autoplay === true) { 1276 1277 _.autoPlay(); 1278 1279 } 1280 1281 }; 1282 1283 Slick.prototype.keyHandler = function(event) { 1284 1285 var _ = this; 1286 1287 if (event.keyCode === 37 && _.options.accessibility === true) { 1288 _.changeSlide({ 1289 data: { 1290 message: 'previous' 1291 } 1292 }); 1293 } else if (event.keyCode === 39 && _.options.accessibility === true) { 1294 _.changeSlide({ 1295 data: { 1296 message: 'next' 1297 } 1298 }); 1299 } 1300 1301 }; 1302 1303 Slick.prototype.lazyLoad = function() { 1304 1305 var _ = this, 1306 loadRange, cloneRange, rangeStart, rangeEnd; 1307 1308 function loadImages(imagesScope) { 1309 $('img[data-lazy]', imagesScope).each(function() { 1310 var image = $(this), 1311 imageSource = $(this).attr('data-lazy'), 1312 imageToLoad = document.createElement('img'); 1313 1314 imageToLoad.onload = function() { 1315 image.animate({ 1316 opacity: 1 1317 }, 200); 1318 }; 1319 imageToLoad.src = imageSource; 1320 1321 image 1322 .css({ 1323 opacity: 0 1324 }) 1325 .attr('src', imageSource) 1326 .removeAttr('data-lazy') 1327 .removeClass('slick-loading'); 1328 }); 1329 } 1330 1331 if (_.options.centerMode === true) { 1332 if (_.options.infinite === true) { 1333 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 1334 rangeEnd = rangeStart + _.options.slidesToShow + 2; 1335 } else { 1336 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 1337 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 1338 } 1339 } else { 1340 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 1341 rangeEnd = rangeStart + _.options.slidesToShow; 1342 if (_.options.fade === true) { 1343 if (rangeStart > 0) rangeStart--; 1344 if (rangeEnd <= _.slideCount) rangeEnd++; 1345 } 1346 } 1347 1348 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 1349 loadImages(loadRange); 1350 1351 if (_.slideCount <= _.options.slidesToShow) { 1352 cloneRange = _.$slider.find('.slick-slide'); 1353 loadImages(cloneRange); 1354 } else 1355 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 1356 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 1357 loadImages(cloneRange); 1358 } else if (_.currentSlide === 0) { 1359 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 1360 loadImages(cloneRange); 1361 } 1362 1363 }; 1364 1365 Slick.prototype.loadSlider = function() { 1366 1367 var _ = this; 1368 1369 _.setPosition(); 1370 1371 _.$slideTrack.css({ 1372 opacity: 1 1373 }); 1374 1375 _.$slider.removeClass('slick-loading'); 1376 1377 _.initUI(); 1378 1379 if (_.options.lazyLoad === 'progressive') { 1380 _.progressiveLazyLoad(); 1381 } 1382 1383 }; 1384 1385 Slick.prototype.next = Slick.prototype.slickNext = function() { 1386 1387 var _ = this; 1388 1389 _.changeSlide({ 1390 data: { 1391 message: 'next' 1392 } 1393 }); 1394 1395 }; 1396 1397 Slick.prototype.orientationChange = function() { 1398 1399 var _ = this; 1400 1401 _.checkResponsive(); 1402 _.setPosition(); 1403 1404 }; 1405 1406 Slick.prototype.pause = Slick.prototype.slickPause = function() { 1407 1408 var _ = this; 1409 1410 _.autoPlayClear(); 1411 _.paused = true; 1412 1413 }; 1414 1415 Slick.prototype.play = Slick.prototype.slickPlay = function() { 1416 1417 var _ = this; 1418 1419 _.paused = false; 1420 _.autoPlay(); 1421 1422 }; 1423 1424 Slick.prototype.postSlide = function(index) { 1425 1426 var _ = this; 1427 1428 _.$slider.trigger('afterChange', [_, index]); 1429 1430 _.animating = false; 1431 1432 _.setPosition(); 1433 1434 _.swipeLeft = null; 1435 1436 if (_.options.autoplay === true && _.paused === false) { 1437 _.autoPlay(); 1438 } 1439 1440 }; 1441 1442 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 1443 1444 var _ = this; 1445 1446 _.changeSlide({ 1447 data: { 1448 message: 'previous' 1449 } 1450 }); 1451 1452 }; 1453 1454 Slick.prototype.preventDefault = function(e) { 1455 e.preventDefault(); 1456 }; 1457 1458 Slick.prototype.progressiveLazyLoad = function() { 1459 1460 var _ = this, 1461 imgCount, targetImage; 1462 1463 imgCount = $('img[data-lazy]', _.$slider).length; 1464 1465 if (imgCount > 0) { 1466 targetImage = $('img[data-lazy]', _.$slider).first(); 1467 targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() { 1468 targetImage.removeAttr('data-lazy'); 1469 _.progressiveLazyLoad(); 1470 1471 if (_.options.adaptiveHeight === true) { 1472 _.setPosition(); 1473 } 1474 }) 1475 .error(function() { 1476 targetImage.removeAttr('data-lazy'); 1477 _.progressiveLazyLoad(); 1478 }); 1479 } 1480 1481 }; 1482 1483 Slick.prototype.refresh = function( initializing ) { 1484 1485 var _ = this, 1486 currentSlide = _.currentSlide; 1487 1488 _.destroy(true); 1489 1490 $.extend(_, _.initials); 1491 1492 _.init(); 1493 1494 if( !initializing ) { 1495 1496 _.changeSlide({ 1497 data: { 1498 message: 'index', 1499 index: currentSlide 1500 } 1501 }, false); 1502 1503 } 1504 1505 }; 1506 1507 Slick.prototype.reinit = function() { 1508 1509 var _ = this; 1510 1511 _.$slides = _.$slideTrack.children(_.options.slide).addClass( 1512 'slick-slide'); 1513 1514 _.slideCount = _.$slides.length; 1515 1516 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 1517 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 1518 } 1519 1520 if (_.slideCount <= _.options.slidesToShow) { 1521 _.currentSlide = 0; 1522 } 1523 1524 _.setProps(); 1525 1526 _.setupInfinite(); 1527 1528 _.buildArrows(); 1529 1530 _.updateArrows(); 1531 1532 _.initArrowEvents(); 1533 1534 _.buildDots(); 1535 1536 _.updateDots(); 1537 1538 _.initDotEvents(); 1539 1540 if (_.options.focusOnSelect === true) { 1541 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 1542 } 1543 1544 _.setSlideClasses(0); 1545 1546 _.setPosition(); 1547 1548 _.$slider.trigger('reInit', [_]); 1549 1550 }; 1551 1552 Slick.prototype.resize = function() { 1553 1554 var _ = this; 1555 1556 if ($(window).width() !== _.windowWidth) { 1557 clearTimeout(_.windowDelay); 1558 _.windowDelay = window.setTimeout(function() { 1559 _.windowWidth = $(window).width(); 1560 _.checkResponsive(); 1561 if( !_.unslicked ) { _.setPosition(); } 1562 }, 50); 1563 } 1564 }; 1565 1566 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 1567 1568 var _ = this; 1569 1570 if (typeof(index) === 'boolean') { 1571 removeBefore = index; 1572 index = removeBefore === true ? 0 : _.slideCount - 1; 1573 } else { 1574 index = removeBefore === true ? --index : index; 1575 } 1576 1577 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 1578 return false; 1579 } 1580 1581 _.unload(); 1582 1583 if (removeAll === true) { 1584 _.$slideTrack.children().remove(); 1585 } else { 1586 _.$slideTrack.children(this.options.slide).eq(index).remove(); 1587 } 1588 1589 _.$slides = _.$slideTrack.children(this.options.slide); 1590 1591 _.$slideTrack.children(this.options.slide).detach(); 1592 1593 _.$slideTrack.append(_.$slides); 1594 1595 _.$slidesCache = _.$slides; 1596 1597 _.reinit(); 1598 1599 }; 1600 1601 Slick.prototype.setCSS = function(position) { 1602 1603 var _ = this, 1604 positionProps = {}, 1605 x, y; 1606 1607 if (_.options.rtl === true) { 1608 position = -position; 1609 } 1610 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 1611 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 1612 1613 positionProps[_.positionProp] = position; 1614 1615 if (_.transformsEnabled === false) { 1616 _.$slideTrack.css(positionProps); 1617 } else { 1618 positionProps = {}; 1619 if (_.cssTransitions === false) { 1620 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 1621 _.$slideTrack.css(positionProps); 1622 } else { 1623 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 1624 _.$slideTrack.css(positionProps); 1625 } 1626 } 1627 1628 }; 1629 1630 Slick.prototype.setDimensions = function() { 1631 1632 var _ = this; 1633 1634 if (_.options.vertical === false) { 1635 if (_.options.centerMode === true) { 1636 _.$list.css({ 1637 padding: ('0px ' + _.options.centerPadding) 1638 }); 1639 } 1640 } else { 1641 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 1642 if (_.options.centerMode === true) { 1643 _.$list.css({ 1644 padding: (_.options.centerPadding + ' 0px') 1645 }); 1646 } 1647 } 1648 1649 _.listWidth = _.$list.width(); 1650 _.listHeight = _.$list.height(); 1651 1652 1653 if (_.options.vertical === false && _.options.variableWidth === false) { 1654 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 1655 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 1656 1657 } else if (_.options.variableWidth === true) { 1658 _.$slideTrack.width(5000 * _.slideCount); 1659 } else { 1660 _.slideWidth = Math.ceil(_.listWidth); 1661 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 1662 } 1663 1664 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 1665 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 1666 1667 }; 1668 1669 Slick.prototype.setFade = function() { 1670 1671 var _ = this, 1672 targetLeft; 1673 1674 _.$slides.each(function(index, element) { 1675 targetLeft = (_.slideWidth * index) * -1; 1676 if (_.options.rtl === true) { 1677 $(element).css({ 1678 position: 'relative', 1679 right: targetLeft, 1680 top: 0, 1681 zIndex: _.options.zIndex - 2, 1682 opacity: 0 1683 }); 1684 } else { 1685 $(element).css({ 1686 position: 'relative', 1687 left: targetLeft, 1688 top: 0, 1689 zIndex: _.options.zIndex - 2, 1690 opacity: 0 1691 }); 1692 } 1693 }); 1694 1695 _.$slides.eq(_.currentSlide).css({ 1696 zIndex: _.options.zIndex - 1, 1697 opacity: 1 1698 }); 1699 1700 }; 1701 1702 Slick.prototype.setHeight = function() { 1703 1704 var _ = this; 1705 1706 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 1707 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 1708 _.$list.css('height', targetHeight); 1709 } 1710 1711 }; 1712 1713 Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) { 1714 1715 var _ = this; 1716 _.options[option] = value; 1717 1718 if (refresh === true) { 1719 _.unload(); 1720 _.reinit(); 1721 } 1722 1723 }; 1724 1725 Slick.prototype.setPosition = function() { 1726 1727 var _ = this; 1728 1729 _.setDimensions(); 1730 1731 _.setHeight(); 1732 1733 if (_.options.fade === false) { 1734 _.setCSS(_.getLeft(_.currentSlide)); 1735 } else { 1736 _.setFade(); 1737 } 1738 1739 _.$slider.trigger('setPosition', [_]); 1740 1741 }; 1742 1743 Slick.prototype.setProps = function() { 1744 1745 var _ = this, 1746 bodyStyle = document.body.style; 1747 1748 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 1749 1750 if (_.positionProp === 'top') { 1751 _.$slider.addClass('slick-vertical'); 1752 } else { 1753 _.$slider.removeClass('slick-vertical'); 1754 } 1755 1756 if (bodyStyle.WebkitTransition !== undefined || 1757 bodyStyle.MozTransition !== undefined || 1758 bodyStyle.msTransition !== undefined) { 1759 if (_.options.useCSS === true) { 1760 _.cssTransitions = true; 1761 } 1762 } 1763 1764 if ( _.options.fade ) { 1765 if ( typeof _.options.zIndex === "number" ) { 1766 if( _.options.zIndex < 3 ) { 1767 _.options.zIndex = 3; 1768 } 1769 } else { 1770 _.options.zIndex = _.defaults.zIndex; 1771 } 1772 } 1773 1774 if (bodyStyle.OTransform !== undefined) { 1775 _.animType = 'OTransform'; 1776 _.transformType = '-o-transform'; 1777 _.transitionType = 'OTransition'; 1778 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 1779 } 1780 if (bodyStyle.MozTransform !== undefined) { 1781 _.animType = 'MozTransform'; 1782 _.transformType = '-moz-transform'; 1783 _.transitionType = 'MozTransition'; 1784 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 1785 } 1786 if (bodyStyle.webkitTransform !== undefined) { 1787 _.animType = 'webkitTransform'; 1788 _.transformType = '-webkit-transform'; 1789 _.transitionType = 'webkitTransition'; 1790 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 1791 } 1792 if (bodyStyle.msTransform !== undefined) { 1793 _.animType = 'msTransform'; 1794 _.transformType = '-ms-transform'; 1795 _.transitionType = 'msTransition'; 1796 if (bodyStyle.msTransform === undefined) _.animType = false; 1797 } 1798 if (bodyStyle.transform !== undefined && _.animType !== false) { 1799 _.animType = 'transform'; 1800 _.transformType = 'transform'; 1801 _.transitionType = 'transition'; 1802 } 1803 _.transformsEnabled = (_.animType !== null && _.animType !== false); 1804 1805 }; 1806 1807 1808 Slick.prototype.setSlideClasses = function(index) { 1809 1810 var _ = this, 1811 centerOffset, allSlides, indexOffset, remainder; 1812 1813 _.$slider.find('.slick-slide').removeClass('slick-active').attr('aria-hidden', 'true').removeClass('slick-center'); 1814 allSlides = _.$slider.find('.slick-slide'); 1815 1816 if (_.options.centerMode === true) { 1817 1818 centerOffset = Math.floor(_.options.slidesToShow / 2); 1819 1820 if (_.options.infinite === true) { 1821 1822 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 1823 _.$slides.slice(index - centerOffset, index + centerOffset + 1).addClass('slick-active').attr('aria-hidden', 'false'); 1824 } else { 1825 indexOffset = _.options.slidesToShow + index; 1826 allSlides.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2).addClass('slick-active').attr('aria-hidden', 'false'); 1827 } 1828 1829 if (index === 0) { 1830 allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center'); 1831 } else if (index === _.slideCount - 1) { 1832 allSlides.eq(_.options.slidesToShow).addClass('slick-center'); 1833 } 1834 1835 } 1836 1837 _.$slides.eq(index).addClass('slick-center'); 1838 1839 } else { 1840 1841 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 1842 _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active').attr('aria-hidden', 'false'); 1843 } else if (allSlides.length <= _.options.slidesToShow) { 1844 allSlides.addClass('slick-active').attr('aria-hidden', 'false'); 1845 } else { 1846 remainder = _.slideCount % _.options.slidesToShow; 1847 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 1848 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 1849 allSlides.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder).addClass('slick-active').attr('aria-hidden', 'false'); 1850 } else { 1851 allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active').attr('aria-hidden', 'false'); 1852 } 1853 } 1854 1855 } 1856 1857 if (_.options.lazyLoad === 'ondemand') { 1858 _.lazyLoad(); 1859 } 1860 1861 }; 1862 1863 Slick.prototype.setupInfinite = function() { 1864 1865 var _ = this, 1866 i, slideIndex, infiniteCount; 1867 1868 if (_.options.fade === true) { 1869 _.options.centerMode = false; 1870 } 1871 1872 if (_.options.infinite === true && _.options.fade === false) { 1873 1874 slideIndex = null; 1875 1876 if (_.slideCount > _.options.slidesToShow) { 1877 1878 if (_.options.centerMode === true) { 1879 infiniteCount = _.options.slidesToShow + 1; 1880 } else { 1881 infiniteCount = _.options.slidesToShow; 1882 } 1883 1884 for (i = _.slideCount; i > (_.slideCount - 1885 infiniteCount); i -= 1) { 1886 slideIndex = i - 1; 1887 $(_.$slides[slideIndex]).clone(true).attr('id', '') 1888 .attr('data-slick-index', slideIndex - _.slideCount) 1889 .prependTo(_.$slideTrack).addClass('slick-cloned'); 1890 } 1891 for (i = 0; i < infiniteCount; i += 1) { 1892 slideIndex = i; 1893 $(_.$slides[slideIndex]).clone(true).attr('id', '') 1894 .attr('data-slick-index', slideIndex + _.slideCount) 1895 .appendTo(_.$slideTrack).addClass('slick-cloned'); 1896 } 1897 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 1898 $(this).attr('id', ''); 1899 }); 1900 1901 } 1902 1903 } 1904 1905 }; 1906 1907 Slick.prototype.setPaused = function(paused) { 1908 1909 var _ = this; 1910 1911 if (_.options.autoplay === true && _.options.pauseOnHover === true) { 1912 _.paused = paused; 1913 if (!paused) { 1914 _.autoPlay(); 1915 } else { 1916 _.autoPlayClear(); 1917 } 1918 } 1919 }; 1920 1921 Slick.prototype.selectHandler = function(event) { 1922 1923 var _ = this; 1924 1925 var targetElement = $(event.target).is('.slick-slide') ? 1926 $(event.target) : 1927 $(event.target).parents('.slick-slide'); 1928 1929 var index = parseInt(targetElement.attr('data-slick-index')); 1930 1931 if (!index) index = 0; 1932 1933 if (_.slideCount <= _.options.slidesToShow) { 1934 _.$slider.find('.slick-slide').removeClass('slick-active').attr('aria-hidden', 'true'); 1935 _.$slides.eq(index).addClass('slick-active').attr("aria-hidden", "false"); 1936 if (_.options.centerMode === true) { 1937 _.$slider.find('.slick-slide').removeClass('slick-center'); 1938 _.$slides.eq(index).addClass('slick-center'); 1939 } 1940 _.asNavFor(index); 1941 return; 1942 } 1943 _.slideHandler(index); 1944 1945 }; 1946 1947 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 1948 1949 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 1950 _ = this; 1951 1952 sync = sync || false; 1953 1954 if (_.animating === true && _.options.waitForAnimate === true) { 1955 return; 1956 } 1957 1958 if (_.options.fade === true && _.currentSlide === index) { 1959 return; 1960 } 1961 1962 if (_.slideCount <= _.options.slidesToShow) { 1963 return; 1964 } 1965 1966 if (sync === false) { 1967 _.asNavFor(index); 1968 } 1969 1970 targetSlide = index; 1971 targetLeft = _.getLeft(targetSlide); 1972 slideLeft = _.getLeft(_.currentSlide); 1973 1974 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 1975 1976 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 1977 if (_.options.fade === false) { 1978 targetSlide = _.currentSlide; 1979 if (dontAnimate !== true) { 1980 _.animateSlide(slideLeft, function() { 1981 _.postSlide(targetSlide); 1982 }); 1983 } else { 1984 _.postSlide(targetSlide); 1985 } 1986 } 1987 return; 1988 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 1989 if (_.options.fade === false) { 1990 targetSlide = _.currentSlide; 1991 if (dontAnimate !== true) { 1992 _.animateSlide(slideLeft, function() { 1993 _.postSlide(targetSlide); 1994 }); 1995 } else { 1996 _.postSlide(targetSlide); 1997 } 1998 } 1999 return; 2000 } 2001 2002 if (_.options.autoplay === true) { 2003 clearInterval(_.autoPlayTimer); 2004 } 2005 2006 if (targetSlide < 0) { 2007 if (_.slideCount % _.options.slidesToScroll !== 0) { 2008 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 2009 } else { 2010 animSlide = _.slideCount + targetSlide; 2011 } 2012 } else if (targetSlide >= _.slideCount) { 2013 if (_.slideCount % _.options.slidesToScroll !== 0) { 2014 animSlide = 0; 2015 } else { 2016 animSlide = targetSlide - _.slideCount; 2017 } 2018 } else { 2019 animSlide = targetSlide; 2020 } 2021 2022 _.animating = true; 2023 2024 _.$slider.trigger("beforeChange", [_, _.currentSlide, animSlide]); 2025 2026 oldSlide = _.currentSlide; 2027 _.currentSlide = animSlide; 2028 2029 _.setSlideClasses(_.currentSlide); 2030 2031 _.updateDots(); 2032 _.updateArrows(); 2033 2034 if (_.options.fade === true) { 2035 if (dontAnimate !== true) { 2036 2037 _.fadeSlideOut(oldSlide); 2038 2039 _.fadeSlide(animSlide, function() { 2040 _.postSlide(animSlide); 2041 }); 2042 2043 } else { 2044 _.postSlide(animSlide); 2045 } 2046 _.animateHeight(); 2047 return; 2048 } 2049 2050 if (dontAnimate !== true) { 2051 _.animateSlide(targetLeft, function() { 2052 _.postSlide(animSlide); 2053 }); 2054 } else { 2055 _.postSlide(animSlide); 2056 } 2057 2058 }; 2059 2060 Slick.prototype.startLoad = function() { 2061 2062 var _ = this; 2063 2064 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 2065 2066 _.$prevArrow.hide(); 2067 _.$nextArrow.hide(); 2068 2069 } 2070 2071 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 2072 2073 _.$dots.hide(); 2074 2075 } 2076 2077 _.$slider.addClass('slick-loading'); 2078 2079 }; 2080 2081 Slick.prototype.swipeDirection = function() { 2082 2083 var xDist, yDist, r, swipeAngle, _ = this; 2084 2085 xDist = _.touchObject.startX - _.touchObject.curX; 2086 yDist = _.touchObject.startY - _.touchObject.curY; 2087 r = Math.atan2(yDist, xDist); 2088 2089 swipeAngle = Math.round(r * 180 / Math.PI); 2090 if (swipeAngle < 0) { 2091 swipeAngle = 360 - Math.abs(swipeAngle); 2092 } 2093 2094 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 2095 return (_.options.rtl === false ? 'left' : 'right'); 2096 } 2097 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 2098 return (_.options.rtl === false ? 'left' : 'right'); 2099 } 2100 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 2101 return (_.options.rtl === false ? 'right' : 'left'); 2102 } 2103 if (_.options.verticalSwiping === true) { 2104 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 2105 return 'left'; 2106 } else { 2107 return 'right'; 2108 } 2109 } 2110 2111 return 'vertical'; 2112 2113 }; 2114 2115 Slick.prototype.swipeEnd = function(event) { 2116 2117 var _ = this, 2118 slideCount; 2119 2120 _.dragging = false; 2121 2122 _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true; 2123 2124 if (_.touchObject.curX === undefined) { 2125 return false; 2126 } 2127 2128 if (_.touchObject.edgeHit === true) { 2129 _.$slider.trigger("edge", [_, _.swipeDirection()]); 2130 } 2131 2132 if (_.touchObject.swipeLength >= _.touchObject.minSwipe) { 2133 2134 switch (_.swipeDirection()) { 2135 case 'left': 2136 slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount(); 2137 _.slideHandler(slideCount); 2138 _.currentDirection = 0; 2139 _.touchObject = {}; 2140 _.$slider.trigger("swipe", [_, "left"]); 2141 break; 2142 2143 case 'right': 2144 slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount(); 2145 _.slideHandler(slideCount); 2146 _.currentDirection = 1; 2147 _.touchObject = {}; 2148 _.$slider.trigger("swipe", [_, "right"]); 2149 break; 2150 } 2151 } else { 2152 if (_.touchObject.startX !== _.touchObject.curX) { 2153 _.slideHandler(_.currentSlide); 2154 _.touchObject = {}; 2155 } 2156 } 2157 2158 }; 2159 2160 Slick.prototype.swipeHandler = function(event) { 2161 2162 var _ = this; 2163 2164 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 2165 return; 2166 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 2167 return; 2168 } 2169 2170 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 2171 event.originalEvent.touches.length : 1; 2172 2173 _.touchObject.minSwipe = _.listWidth / _.options 2174 .touchThreshold; 2175 2176 if (_.options.verticalSwiping === true) { 2177 _.touchObject.minSwipe = _.listHeight / _.options 2178 .touchThreshold; 2179 } 2180 2181 switch (event.data.action) { 2182 2183 case 'start': 2184 _.swipeStart(event); 2185 break; 2186 2187 case 'move': 2188 _.swipeMove(event); 2189 break; 2190 2191 case 'end': 2192 _.swipeEnd(event); 2193 break; 2194 2195 } 2196 2197 }; 2198 2199 Slick.prototype.swipeMove = function(event) { 2200 2201 var _ = this, 2202 edgeWasHit = false, 2203 curLeft, swipeDirection, swipeLength, positionOffset, touches; 2204 2205 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 2206 2207 if (!_.dragging || touches && touches.length !== 1) { 2208 return false; 2209 } 2210 2211 curLeft = _.getLeft(_.currentSlide); 2212 2213 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 2214 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 2215 2216 _.touchObject.swipeLength = Math.round(Math.sqrt( 2217 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 2218 2219 if (_.options.verticalSwiping === true) { 2220 _.touchObject.swipeLength = Math.round(Math.sqrt( 2221 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 2222 } 2223 2224 swipeDirection = _.swipeDirection(); 2225 2226 if (swipeDirection === 'vertical') { 2227 return; 2228 } 2229 2230 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 2231 event.preventDefault(); 2232 } 2233 2234 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 2235 if (_.options.verticalSwiping === true) { 2236 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 2237 } 2238 2239 2240 swipeLength = _.touchObject.swipeLength; 2241 2242 _.touchObject.edgeHit = false; 2243 2244 if (_.options.infinite === false) { 2245 if ((_.currentSlide === 0 && swipeDirection === "right") || (_.currentSlide >= _.getDotCount() && swipeDirection === "left")) { 2246 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 2247 _.touchObject.edgeHit = true; 2248 } 2249 } 2250 2251 if (_.options.vertical === false) { 2252 _.swipeLeft = curLeft + swipeLength * positionOffset; 2253 } else { 2254 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 2255 } 2256 if (_.options.verticalSwiping === true) { 2257 _.swipeLeft = curLeft + swipeLength * positionOffset; 2258 } 2259 2260 if (_.options.fade === true || _.options.touchMove === false) { 2261 return false; 2262 } 2263 2264 if (_.animating === true) { 2265 _.swipeLeft = null; 2266 return false; 2267 } 2268 2269 _.setCSS(_.swipeLeft); 2270 2271 }; 2272 2273 Slick.prototype.swipeStart = function(event) { 2274 2275 var _ = this, 2276 touches; 2277 2278 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 2279 _.touchObject = {}; 2280 return false; 2281 } 2282 2283 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 2284 touches = event.originalEvent.touches[0]; 2285 } 2286 2287 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 2288 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 2289 2290 _.dragging = true; 2291 2292 }; 2293 2294 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 2295 2296 var _ = this; 2297 2298 if (_.$slidesCache !== null) { 2299 2300 _.unload(); 2301 2302 _.$slideTrack.children(this.options.slide).detach(); 2303 2304 _.$slidesCache.appendTo(_.$slideTrack); 2305 2306 _.reinit(); 2307 2308 } 2309 2310 }; 2311 2312 Slick.prototype.unload = function() { 2313 2314 var _ = this; 2315 2316 $('.slick-cloned', _.$slider).remove(); 2317 if (_.$dots) { 2318 _.$dots.remove(); 2319 } 2320 if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) { 2321 _.$prevArrow.remove(); 2322 } 2323 if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) { 2324 _.$nextArrow.remove(); 2325 } 2326 _.$slides.removeClass('slick-slide slick-active slick-visible').attr("aria-hidden", "true").css('width', ''); 2327 2328 }; 2329 2330 Slick.prototype.unslick = function(fromBreakpoint) { 2331 2332 var _ = this; 2333 _.$slider.trigger('unslick', [_, fromBreakpoint]); 2334 _.destroy(); 2335 2336 }; 2337 2338 Slick.prototype.updateArrows = function() { 2339 2340 var _ = this, 2341 centerOffset; 2342 2343 centerOffset = Math.floor(_.options.slidesToShow / 2); 2344 2345 if (_.options.arrows === true && _.options.infinite !== 2346 true && _.slideCount > _.options.slidesToShow) { 2347 _.$prevArrow.removeClass('slick-disabled'); 2348 _.$nextArrow.removeClass('slick-disabled'); 2349 if (_.currentSlide === 0) { 2350 _.$prevArrow.addClass('slick-disabled'); 2351 _.$nextArrow.removeClass('slick-disabled'); 2352 } else if (_.currentSlide >
2352= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 2353 _.$nextArrow.addClass('slick-disabled'); 2354 _.$prevArrow.removeClass('slick-disabled'); 2355 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 2356 _.$nextArrow.addClass('slick-disabled'); 2357 _.$prevArrow.removeClass('slick-disabled'); 2358 } 2359 } 2360 2361 }; 2362 2363 Slick.prototype.updateDots = function() { 2364 2365 var _ = this; 2366 2367 if (_.$dots !== null) { 2368 2369 _.$dots.find('li').removeClass('slick-active').attr("aria-hidden", "true"); 2370 _.$dots.find('li').eq(Math.floor(_.currentSlide / _.options.slidesToScroll)).addClass('slick-active').attr("aria-hidden", "false"); 2371 2372 } 2373 2374 }; 2375 2376 Slick.prototype.visibility = function() { 2377 2378 var _ = this; 2379 2380 if (document[_.hidden]) { 2381 _.paused = true; 2382 _.autoPlayClear(); 2383 } else { 2384 if (_.options.autoplay === true) { 2385 _.paused = false; 2386 _.autoPlay(); 2387 } 2388 } 2389 2390 }; 2391 2392 $.fn.slick = function() { 2393 var _ = this, 2394 opt = arguments[0], 2395 args = Array.prototype.slice.call(arguments, 1), 2396 l = _.length, 2397 i = 0, 2398 ret; 2399 for (i; i < l; i++) { 2400 if (typeof opt == 'object' || typeof opt == 'undefined') 2401 _[i].slick = new Slick(_[i], opt); 2402 else 2403 ret = _[i].slick[opt].apply(_[i].slick, args); 2404 if (typeof ret != 'undefined') return ret; 2405 } 2406 return _; 2407 }; 2408 2409}));
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.