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