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