Smooth Slider - Version 2.6.5

Version Description

If you have Smooth Slider 2.6 or plus, kindly update to 2.6.3 for proper height calcualtion for responsiveness.

= Before Upgrading =

  • Note the Title and Content fonts on your old Smooth Slider.
  • Go to 'Settings' panel and 'Save Changes'.
  • Recheck the Slider Title, Post Title and the Slider Content fonts on the Settings Panel.

Get older versions

Download this release

Release Info

Developer internet techies
Plugin Icon 128x128 Smooth Slider
Version 2.6.5
Comparing to
See all releases

Code changes from version 2.6.4 to 2.6.5

css/skins/default/functions.php CHANGED
@@ -189,8 +189,8 @@ function smooth_slider_get_default($slider_handle,$r_array,$slider_id='',$echo='
189
  $smooth_slider_css = smooth_get_inline_css();
190
  $html='';
191
 
192
- wp_enqueue_script( 'jquery.cycle', smooth_slider_plugin_url( 'js/jcycle.js' ),array('jquery'), SMOOTH_SLIDER_VER, false);
193
- wp_enqueue_script( 'smooth-slider', smooth_slider_plugin_url( 'js/smooth.js' ),array('jquery'), SMOOTH_SLIDER_VER, false);
194
  /* Changed fouc code start 2.6 - Bug fix in 2.6.2.1 */
195
  if(!isset($smooth_slider['fouc']) or $smooth_slider['fouc']=='' or $smooth_slider['fouc']=='0' ){
196
  $fouc_dom='jQuery("html").addClass("smooth_slider_fouc");jQuery(".smooth_slider_fouc .smooth_slider").hide();';
@@ -205,7 +205,7 @@ function smooth_slider_get_default($slider_handle,$r_array,$slider_id='',$echo='
205
  $html.='<script type="text/javascript">';
206
  $html.=$fouc_ready;
207
  $html.='jQuery(document).ready(function() {
208
- jQuery("#'.$slider_handle.'").cycle({
209
  fx: "'.$smooth_slider['fx'].'",
210
  speed:"'.$smooth_slider['transition'] * 100 .'",
211
  timeout: '. ( ($smooth_slider['autostep'] == '1') ? ( $smooth_slider['speed'] * 1000 ) : 0 ) .',';
189
  $smooth_slider_css = smooth_get_inline_css();
190
  $html='';
191
 
192
+ wp_enqueue_script( 'smooth', smooth_slider_plugin_url( 'js/smooth.js' ),array('jquery'), SMOOTH_SLIDER_VER, false);
193
+ wp_enqueue_script( 'smooth-dim', smooth_slider_plugin_url( 'js/dim.js' ),array('jquery'), SMOOTH_SLIDER_VER, false);
194
  /* Changed fouc code start 2.6 - Bug fix in 2.6.2.1 */
195
  if(!isset($smooth_slider['fouc']) or $smooth_slider['fouc']=='' or $smooth_slider['fouc']=='0' ){
196
  $fouc_dom='jQuery("html").addClass("smooth_slider_fouc");jQuery(".smooth_slider_fouc .smooth_slider").hide();';
205
  $html.='<script type="text/javascript">';
206
  $html.=$fouc_ready;
207
  $html.='jQuery(document).ready(function() {
208
+ jQuery("#'.$slider_handle.'").smooth({
209
  fx: "'.$smooth_slider['fx'].'",
210
  speed:"'.$smooth_slider['transition'] * 100 .'",
211
  timeout: '. ( ($smooth_slider['autostep'] == '1') ? ( $smooth_slider['speed'] * 1000 ) : 0 ) .',';
css/skins/default/style.css CHANGED
@@ -4,7 +4,7 @@ Smooth Slider default styles*/
4
  .smooth_slider div,.smooth_slider p,.smooth_slider span,.smooth_slider img,.smooth_slider h2{list-style:none;vertical-align:baseline;}
5
  .smooth_slider ul{list-style:disc;vertical-align:baseline;list-style-position:inside;}
6
  .smooth_slider li{vertical-align:baseline;}
7
- .smooth_slider{padding:0 5px;width:100%;}
8
  .smooth_slider .sldr_title{margin:5px 0 10px 0;}
9
  .smooth_slider span{display:inline;overflow:hidden;margin: 10px auto;line-height:18px;}
10
  .smooth_slider .smooth_sliderb{position:relative;}
4
  .smooth_slider div,.smooth_slider p,.smooth_slider span,.smooth_slider img,.smooth_slider h2{list-style:none;vertical-align:baseline;}
5
  .smooth_slider ul{list-style:disc;vertical-align:baseline;list-style-position:inside;}
6
  .smooth_slider li{vertical-align:baseline;}
7
+ .smooth_slider{padding:0 5px;width:100%;box-sizing: border-box;}
8
  .smooth_slider .sldr_title{margin:5px 0 10px 0;}
9
  .smooth_slider span{display:inline;overflow:hidden;margin: 10px auto;line-height:18px;}
10
  .smooth_slider .smooth_sliderb{position:relative;}
js/dim.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+ jQuery.fn.smoothSlider=function(args){
3
+ var defaults={
4
+ sliderWidth :900,
5
+ sliderHeight :320,
6
+ navArr :0,
7
+ img_align :'left'
8
+ }
9
+ var options=jQuery.extend({},defaults,args);
10
+ var self=this;
11
+ this.smoothSliderSize=function(){
12
+ var wrapWidth=this.width();
13
+ var slideri=this.find('.smooth_slideri');
14
+ var slideriW;
15
+ //calculate max-width of slideri
16
+ if(options.navArr==0) slideriW=wrapWidth;
17
+ else slideriW=wrapWidth-(48+10); //48px for arrows and 10 for additional margin for text
18
+ slideri.css('max-width',slideriW+'px');
19
+ //float excerpt below image
20
+ if(options.img_align=='left' || options.img_align=='right'){
21
+ var sldrThumb=this.find('.smooth_slider_thumbnail');
22
+ var sldrThumbW=sldrThumb.outerWidth(true);
23
+ if(slideriW-sldrThumbW < 70){
24
+ if(options.img_align=='right')sldrThumb.removeClass('smoothRight');
25
+ else sldrThumb.removeClass('smoothLeft');
26
+ sldrThumb.addClass('smoothNone');
27
+ }
28
+ else{
29
+ sldrThumb.removeClass('smoothNone');
30
+ if(options.img_align=='right')sldrThumb.addClass('smoothRight');
31
+ else sldrThumb.addClass('smoothLeft');
32
+ }
33
+ }
34
+ //slider height
35
+ var iht=0;
36
+ this.find(".smooth_slideri").each(function(idx,el){
37
+ if(jQuery(el).outerHeight(true)>iht)iht=jQuery(el).outerHeight(true);
38
+ });
39
+ var eHt=this.find(".sldr_title").outerHeight(true) + this.find(".smooth_nav").outerHeight(true);
40
+ var ht=iht + eHt;
41
+ this.height(ht);
42
+ this.find(".smooth_slider_thumbnail").on('load',function(e){
43
+ var pHt=jQuery(this).parents(".smooth_slideri").outerHeight(true)+eHt;
44
+ if(pHt > ht)ht=pHt;
45
+ self.height(ht);
46
+ });
47
+ return this;
48
+ };
49
+ this.smoothSliderSize();
50
+
51
+ //On Window Resize
52
+ jQuery(window).resize(function() {
53
+ self.smoothSliderSize();
54
+ });
55
+ }
56
+ })(jQuery);
js/jcycle.js DELETED
@@ -1,1543 +0,0 @@
1
- /*!
2
- * jQuery Cycle Plugin (with Transition Definitions)
3
- * Examples and documentation at: http://jquery.malsup.com/cycle/
4
- * Copyright (c) 2007-2013 M. Alsup
5
- * Version: 3.0.3 (11-JUL-2013)
6
- * Dual licensed under the MIT and GPL licenses.
7
- * http://jquery.malsup.com/license.html
8
- * Requires: jQuery v1.7.1 or later
9
- */
10
- ;(function($, undefined) {
11
- "use strict";
12
-
13
- var ver = '3.0.3';
14
-
15
- function debug(s) {
16
- if ($.fn.cycle.debug)
17
- log(s);
18
- }
19
- function log() {
20
- /*global console */
21
- if (window.console && console.log)
22
- console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
23
- }
24
- $.expr[':'].paused = function(el) {
25
- return el.cyclePause;
26
- };
27
-
28
-
29
- // the options arg can be...
30
- // a number - indicates an immediate transition should occur to the given slide index
31
- // a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
32
- // an object - properties to control the slideshow
33
- //
34
- // the arg2 arg can be...
35
- // the name of an fx (only used in conjunction with a numeric value for 'options')
36
- // the value true (only used in first arg == 'resume') and indicates
37
- // that the resume should occur immediately (not wait for next timeout)
38
-
39
- $.fn.cycle = function(options, arg2) {
40
- var o = { s: this.selector, c: this.context };
41
-
42
- // in 1.3+ we can fix mistakes with the ready state
43
- if (this.length === 0 && options != 'stop') {
44
- if (!$.isReady && o.s) {
45
- log('DOM not ready, queuing slideshow');
46
- $(function() {
47
- $(o.s,o.c).cycle(options,arg2);
48
- });
49
- return this;
50
- }
51
- // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
52
- log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
53
- return this;
54
- }
55
-
56
- // iterate the matched nodeset
57
- return this.each(function() {
58
- var opts = handleArguments(this, options, arg2);
59
- if (opts === false)
60
- return;
61
-
62
- opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;
63
-
64
- // stop existing slideshow for this container (if there is one)
65
- if (this.cycleTimeout)
66
- clearTimeout(this.cycleTimeout);
67
- this.cycleTimeout = this.cyclePause = 0;
68
- this.cycleStop = 0; // issue #108
69
-
70
- var $cont = $(this);
71
- var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
72
- var els = $slides.get();
73
-
74
- if (els.length < 2) {
75
- log('terminating; too few slides: ' + els.length);
76
- return;
77
- }
78
-
79
- var opts2 = buildOptions($cont, $slides, els, opts, o);
80
- if (opts2 === false)
81
- return;
82
-
83
- var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
84
-
85
- // if it's an auto slideshow, kick it off
86
- if (startTime) {
87
- startTime += (opts2.delay || 0);
88
- if (startTime < 10)
89
- startTime = 10;
90
- debug('first timeout: ' + startTime);
91
- this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime);
92
- }
93
- });
94
- };
95
-
96
- function triggerPause(cont, byHover, onPager) {
97
- var opts = $(cont).data('cycle.opts');
98
- if (!opts)
99
- return;
100
- var paused = !!cont.cyclePause;
101
- if (paused && opts.paused)
102
- opts.paused(cont, opts, byHover, onPager);
103
- else if (!paused && opts.resumed)
104
- opts.resumed(cont, opts, byHover, onPager);
105
- }
106
-
107
- // process the args that were passed to the plugin fn
108
- function handleArguments(cont, options, arg2) {
109
- if (cont.cycleStop === undefined)
110
- cont.cycleStop = 0;
111
- if (options === undefined || options === null)
112
- options = {};
113
- if (options.constructor == String) {
114
- switch(options) {
115
- case 'destroy':
116
- case 'stop':
117
- var opts = $(cont).data('cycle.opts');
118
- if (!opts)
119
- return false;
120
- cont.cycleStop++; // callbacks look for change
121
- if (cont.cycleTimeout)
122
- clearTimeout(cont.cycleTimeout);
123
- cont.cycleTimeout = 0;
124
- if (opts.elements)
125
- $(opts.elements).stop();
126
- $(cont).removeData('cycle.opts');
127
- if (options == 'destroy')
128
- destroy(cont, opts);
129
- return false;
130
- case 'toggle':
131
- cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
132
- checkInstantResume(cont.cyclePause, arg2, cont);
133
- triggerPause(cont);
134
- return false;
135
- case 'pause':
136
- cont.cyclePause = 1;
137
- triggerPause(cont);
138
- return false;
139
- case 'resume':
140
- cont.cyclePause = 0;
141
- checkInstantResume(false, arg2, cont);
142
- triggerPause(cont);
143
- return false;
144
- case 'prev':
145
- case 'next':
146
- opts = $(cont).data('cycle.opts');
147
- if (!opts) {
148
- log('options not found, "prev/next" ignored');
149
- return false;
150
- }
151
- if (typeof arg2 == 'string')
152
- opts.oneTimeFx = arg2;
153
- $.fn.cycle[options](opts);
154
- return false;
155
- default:
156
- options = { fx: options };
157
- }
158
- return options;
159
- }
160
- else if (options.constructor == Number) {
161
- // go to the requested slide
162
- var num = options;
163
- options = $(cont).data('cycle.opts');
164
- if (!options) {
165
- log('options not found, can not advance slide');
166
- return false;
167
- }
168
- if (num < 0 || num >= options.elements.length) {
169
- log('invalid slide index: ' + num);
170
- return false;
171
- }
172
- options.nextSlide = num;
173
- if (cont.cycleTimeout) {
174
- clearTimeout(cont.cycleTimeout);
175
- cont.cycleTimeout = 0;
176
- }
177
- if (typeof arg2 == 'string')
178
- options.oneTimeFx = arg2;
179
- go(options.elements, options, 1, num >= options.currSlide);
180
- return false;
181
- }
182
- return options;
183
-
184
- function checkInstantResume(isPaused, arg2, cont) {
185
- if (!isPaused && arg2 === true) { // resume now!
186
- var options = $(cont).data('cycle.opts');
187
- if (!options) {
188
- log('options not found, can not resume');
189
- return false;
190
- }
191
- if (cont.cycleTimeout) {
192
- clearTimeout(cont.cycleTimeout);
193
- cont.cycleTimeout = 0;
194
- }
195
- go(options.elements, options, 1, !options.backwards);
196
- }
197
- }
198
- }
199
-
200
- function removeFilter(el, opts) {
201
- if (!$.support.opacity && opts.cleartype && el.style.filter) {
202
- try { el.style.removeAttribute('filter'); }
203
- catch(smother) {} // handle old opera versions
204
- }
205
- }
206
-
207
- // unbind event handlers
208
- function destroy(cont, opts) {
209
- if (opts.next)
210
- $(opts.next).unbind(opts.prevNextEvent);
211
- if (opts.prev)
212
- $(opts.prev).unbind(opts.prevNextEvent);
213
-
214
- if (opts.pager || opts.pagerAnchorBuilder)
215
- $.each(opts.pagerAnchors || [], function() {
216
- this.unbind().remove();
217
- });
218
- opts.pagerAnchors = null;
219
- $(cont).unbind('mouseenter.cycle mouseleave.cycle');
220
- if (opts.destroy) // callback
221
- opts.destroy(opts);
222
- }
223
-
224
- // one-time initialization
225
- function buildOptions($cont, $slides, els, options, o) {
226
- var startingSlideSpecified;
227
- // support metadata plugin (v1.0 and v2.0)
228
- var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
229
- var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
230
- if (meta)
231
- opts = $.extend(opts, meta);
232
- if (opts.autostop)
233
- opts.countdown = opts.autostopCount || els.length;
234
-
235
- var cont = $cont[0];
236
- $cont.data('cycle.opts', opts);
237
- opts.$cont = $cont;
238
- opts.stopCount = cont.cycleStop;
239
- opts.elements = els;
240
- opts.before = opts.before ? [opts.before] : [];
241
- opts.after = opts.after ? [opts.after] : [];
242
-
243
- // push some after callbacks
244
- if (!$.support.opacity && opts.cleartype)
245
- opts.after.push(function() { removeFilter(this, opts); });
246
- if (opts.continuous)
247
- opts.after.push(function() { go(els,opts,0,!opts.backwards); });
248
-
249
- saveOriginalOpts(opts);
250
-
251
- // clearType corrections
252
- if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
253
- clearTypeFix($slides);
254
-
255
- // container requires non-static position so that slides can be position within
256
- if ($cont.css('position') == 'static')
257
- $cont.css('position', 'relative');
258
- if (opts.width)
259
- $cont.width(opts.width);
260
- if (opts.height && opts.height != 'auto')
261
- $cont.height(opts.height);
262
-
263
- if (opts.startingSlide !== undefined) {
264
- opts.startingSlide = parseInt(opts.startingSlide,10);
265
- if (opts.startingSlide >= els.length || opts.startSlide < 0)
266
- opts.startingSlide = 0; // catch bogus input
267
- else
268
- startingSlideSpecified = true;
269
- }
270
- else if (opts.backwards)
271
- opts.startingSlide = els.length - 1;
272
- else
273
- opts.startingSlide = 0;
274
-
275
- // if random, mix up the slide array
276
- if (opts.random) {
277
- opts.randomMap = [];
278
- for (var i = 0; i < els.length; i++)
279
- opts.randomMap.push(i);
280
- opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
281
- if (startingSlideSpecified) {
282
- // try to find the specified starting slide and if found set start slide index in the map accordingly
283
- for ( var cnt = 0; cnt < els.length; cnt++ ) {
284
- if ( opts.startingSlide == opts.randomMap[cnt] ) {
285
- opts.randomIndex = cnt;
286
- }
287
- }
288
- }
289
- else {
290
- opts.randomIndex = 1;
291
- opts.startingSlide = opts.randomMap[1];
292
- }
293
- }
294
- else if (opts.startingSlide >= els.length)
295
- opts.startingSlide = 0; // catch bogus input
296
- opts.currSlide = opts.startingSlide || 0;
297
- var first = opts.startingSlide;
298
-
299
- // set position and zIndex on all the slides
300
- $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
301
- var z;
302
- if (opts.backwards)
303
- z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
304
- else
305
- z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
306
- $(this).css('z-index', z);
307
- });
308
-
309
- // make sure first slide is visible
310
- $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
311
- removeFilter(els[first], opts);
312
-
313
- // stretch slides
314
- if (opts.fit) {
315
- if (!opts.aspect) {
316
- if (opts.width)
317
- $slides.width(opts.width);
318
- if (opts.height && opts.height != 'auto')
319
- $slides.height(opts.height);
320
- } else {
321
- $slides.each(function(){
322
- var $slide = $(this);
323
- var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect;
324
- if( opts.width && $slide.width() != opts.width ) {
325
- $slide.width( opts.width );
326
- $slide.height( opts.width / ratio );
327
- }
328
-
329
- if( opts.height && $slide.height() < opts.height ) {
330
- $slide.height( opts.height );
331
- $slide.width( opts.height * ratio );
332
- }
333
- });
334
- }
335
- }
336
-
337
- if (opts.center && ((!opts.fit) || opts.aspect)) {
338
- $slides.each(function(){
339
- var $slide = $(this);
340
- $slide.css({
341
- "margin-left": opts.width ?
342
- ((opts.width - $slide.width()) / 2) + "px" :
343
- 0,
344
- "margin-top": opts.height ?
345
- ((opts.height - $slide.height()) / 2) + "px" :
346
- 0
347
- });
348
- });
349
- }
350
-
351
- if (opts.center && !opts.fit && !opts.slideResize) {
352
- $slides.each(function(){
353
- var $slide = $(this);
354
- $slide.css({
355
- "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0,
356
- "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0
357
- });
358
- });
359
- }
360
-
361
- // stretch container
362
- var reshape = (opts.containerResize || opts.containerResizeHeight) && $cont.innerHeight() < 1;
363
- if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
364
- var maxw = 0, maxh = 0;
365
- for(var j=0; j < els.length; j++) {
366
- var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
367
- if (!w) w = e.offsetWidth || e.width || $e.attr('width');
368
- if (!h) h = e.offsetHeight || e.height || $e.attr('height');
369
- maxw = w > maxw ? w : maxw;
370
- maxh = h > maxh ? h : maxh;
371
- }
372
- if (opts.containerResize && maxw > 0 && maxh > 0)
373
- $cont.css({width:maxw+'px',height:maxh+'px'});
374
- if (opts.containerResizeHeight && maxh > 0)
375
- $cont.css({height:maxh+'px'});
376
- }
377
-
378
- var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
379
- if (opts.pause)
380
- $cont.bind('mouseenter.cycle', function(){
381
- pauseFlag = true;
382
- this.cyclePause++;
383
- triggerPause(cont, true);
384
- }).bind('mouseleave.cycle', function(){
385
- if (pauseFlag)
386
- this.cyclePause--;
387
- triggerPause(cont, true);
388
- });
389
-
390
- if (supportMultiTransitions(opts) === false)
391
- return false;
392
-
393
- // apparently a lot of people use image slideshows without height/width attributes on the images.
394
- // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
395
- var requeue = false;
396
- options.requeueAttempts = options.requeueAttempts || 0;
397
- $slides.each(function() {
398
- // try to get height/width of each slide
399
- var $el = $(this);
400
- this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
401
- this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
402
-
403
- if ( $el.is('img') ) {
404
- var loading = (this.cycleH === 0 && this.cycleW === 0 && !this.complete);
405
- // don't requeue for images that are still loading but have a valid size
406
- if (loading) {
407
- if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
408
- log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
409
- setTimeout(function() {$(o.s,o.c).cycle(options);}, opts.requeueTimeout);
410
- requeue = true;
411
- return false; // break each loop
412
- }
413
- else {
414
- log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
415
- }
416
- }
417
- }
418
- return true;
419
- });
420
-
421
- if (requeue)
422
- return false;
423
-
424
- opts.cssBefore = opts.cssBefore || {};
425
- opts.cssAfter = opts.cssAfter || {};
426
- opts.cssFirst = opts.cssFirst || {};
427
- opts.animIn = opts.animIn || {};
428
- opts.animOut = opts.animOut || {};
429
-
430
- $slides.not(':eq('+first+')').css(opts.cssBefore);
431
- $($slides[first]).css(opts.cssFirst);
432
-
433
- if (opts.timeout) {
434
- opts.timeout = parseInt(opts.timeout,10);
435
- // ensure that timeout and speed settings are sane
436
- if (opts.speed.constructor == String)
437
- opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10);
438
- if (!opts.sync)
439
- opts.speed = opts.speed / 2;
440
-
441
- var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250;
442
- while((opts.timeout - opts.speed) < buffer) // sanitize timeout
443
- opts.timeout += opts.speed;
444
- }
445
- if (opts.easing)
446
- opts.easeIn = opts.easeOut = opts.easing;
447
- if (!opts.speedIn)
448
- opts.speedIn = opts.speed;
449
- if (!opts.speedOut)
450
- opts.speedOut = opts.speed;
451
-
452
- opts.slideCount = els.length;
453
- opts.currSlide = opts.lastSlide = first;
454
- if (opts.random) {
455
- if (++opts.randomIndex == els.length)
456
- opts.randomIndex = 0;
457
- opts.nextSlide = opts.randomMap[opts.randomIndex];
458
- }
459
- else if (opts.backwards)
460
- opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1;
461
- else
462
- opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
463
-
464
- // run transition init fn
465
- if (!opts.multiFx) {
466
- var init = $.fn.cycle.transitions[opts.fx];
467
- if ($.isFunction(init))
468
- init($cont, $slides, opts);
469
- else if (opts.fx != 'custom' && !opts.multiFx) {
470
- log('unknown transition: ' + opts.fx,'; slideshow terminating');
471
- return false;
472
- }
473
- }
474
-
475
- // fire artificial events
476
- var e0 = $slides[first];
477
- if (!opts.skipInitializationCallbacks) {
478
- if (opts.before.length)
479
- opts.before[0].apply(e0, [e0, e0, opts, true]);
480
- if (opts.after.length)
481
- opts.after[0].apply(e0, [e0, e0, opts, true]);
482
- }
483
- if (opts.next)
484
- $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});
485
- if (opts.prev)
486
- $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});
487
- if (opts.pager || opts.pagerAnchorBuilder)
488
- buildPager(els,opts);
489
-
490
- exposeAddSlide(opts, els);
491
-
492
- return opts;
493
- }
494
-
495
- // save off original opts so we can restore after clearing state
496
- function saveOriginalOpts(opts) {
497
- opts.original = { before: [], after: [] };
498
- opts.original.cssBefore = $.extend({}, opts.cssBefore);
499
- opts.original.cssAfter = $.extend({}, opts.cssAfter);
500
- opts.original.animIn = $.extend({}, opts.animIn);
501
- opts.original.animOut = $.extend({}, opts.animOut);
502
- $.each(opts.before, function() { opts.original.before.push(this); });
503
- $.each(opts.after, function() { opts.original.after.push(this); });
504
- }
505
-
506
- function supportMultiTransitions(opts) {
507
- var i, tx, txs = $.fn.cycle.transitions;
508
- // look for multiple effects
509
- if (opts.fx.indexOf(',') > 0) {
510
- opts.multiFx = true;
511
- opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
512
- // discard any bogus effect names
513
- for (i=0; i < opts.fxs.length; i++) {
514
- var fx = opts.fxs[i];
515
- tx = txs[fx];
516
- if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
517
- log('discarding unknown transition: ',fx);
518
- opts.fxs.splice(i,1);
519
- i--;
520
- }
521
- }
522
- // if we have an empty list then we threw everything away!
523
- if (!opts.fxs.length) {
524
- log('No valid transitions named; slideshow terminating.');
525
- return false;
526
- }
527
- }
528
- else if (opts.fx == 'all') { // auto-gen the list of transitions
529
- opts.multiFx = true;
530
- opts.fxs = [];
531
- for (var p in txs) {
532
- if (txs.hasOwnProperty(p)) {
533
- tx = txs[p];
534
- if (txs.hasOwnProperty(p) && $.isFunction(tx))
535
- opts.fxs.push(p);
536
- }
537
- }
538
- }
539
- if (opts.multiFx && opts.randomizeEffects) {
540
- // munge the fxs array to make effect selection random
541
- var r1 = Math.floor(Math.random() * 20) + 30;
542
- for (i = 0; i < r1; i++) {
543
- var r2 = Math.floor(Math.random() * opts.fxs.length);
544
- opts.fxs.push(opts.fxs.splice(r2,1)[0]);
545
- }
546
- debug('randomized fx sequence: ',opts.fxs);
547
- }
548
- return true;
549
- }
550
-
551
- // provide a mechanism for adding slides after the slideshow has started
552
- function exposeAddSlide(opts, els) {
553
- opts.addSlide = function(newSlide, prepend) {
554
- var $s = $(newSlide), s = $s[0];
555
- if (!opts.autostopCount)
556
- opts.countdown++;
557
- els[prepend?'unshift':'push'](s);
558
- if (opts.els)
559
- opts.els[prepend?'unshift':'push'](s); // shuffle needs this
560
- opts.slideCount = els.length;
561
-
562
- // add the slide to the random map and resort
563
- if (opts.random) {
564
- opts.randomMap.push(opts.slideCount-1);
565
- opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
566
- }
567
-
568
- $s.css('position','absolute');
569
- $s[prepend?'prependTo':'appendTo'](opts.$cont);
570
-
571
- if (prepend) {
572
- opts.currSlide++;
573
- opts.nextSlide++;
574
- }
575
-
576
- if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
577
- clearTypeFix($s);
578
-
579
- if (opts.fit && opts.width)
580
- $s.width(opts.width);
581
- if (opts.fit && opts.height && opts.height != 'auto')
582
- $s.height(opts.height);
583
- s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
584
- s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
585
-
586
- $s.css(opts.cssBefore);
587
-
588
- if (opts.pager || opts.pagerAnchorBuilder)
589
- $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
590
-
591
- if ($.isFunction(opts.onAddSlide))
592
- opts.onAddSlide($s);
593
- else
594
- $s.hide(); // default behavior
595
- };
596
- }
597
-
598
- // reset internal state; we do this on every pass in order to support multiple effects
599
- $.fn.cycle.resetState = function(opts, fx) {
600
- fx = fx || opts.fx;
601
- opts.before = []; opts.after = [];
602
- opts.cssBefore = $.extend({}, opts.original.cssBefore);
603
- opts.cssAfter = $.extend({}, opts.original.cssAfter);
604
- opts.animIn = $.extend({}, opts.original.animIn);
605
- opts.animOut = $.extend({}, opts.original.animOut);
606
- opts.fxFn = null;
607
- $.each(opts.original.before, function() { opts.before.push(this); });
608
- $.each(opts.original.after, function() { opts.after.push(this); });
609
-
610
- // re-init
611
- var init = $.fn.cycle.transitions[fx];
612
- if ($.isFunction(init))
613
- init(opts.$cont, $(opts.elements), opts);
614
- };
615
-
616
- // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
617
- function go(els, opts, manual, fwd) {
618
- var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
619
-
620
- // opts.busy is true if we're in the middle of an animation
621
- if (manual && opts.busy && opts.manualTrump) {
622
- // let manual transitions requests trump active ones
623
- debug('manualTrump in go(), stopping active transition');
624
- $(els).stop(true,true);
625
- opts.busy = 0;
626
- clearTimeout(p.cycleTimeout);
627
- }
628
-
629
- // don't begin another timeout-based transition if there is one active
630
- if (opts.busy) {
631
- debug('transition active, ignoring new tx request');
632
- return;
633
- }
634
-
635
-
636
- // stop cycling if we have an outstanding stop request
637
- if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
638
- return;
639
-
640
- // check to see if we should stop cycling based on autostop options
641
- if (!manual && !p.cyclePause && !opts.bounce &&
642
- ((opts.autostop && (--opts.countdown <= 0)) ||
643
- (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
644
- if (opts.end)
645
- opts.end(opts);
646
- return;
647
- }
648
-
649
- // if slideshow is paused, only transition on a manual trigger
650
- var changed = false;
651
- if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
652
- changed = true;
653
- var fx = opts.fx;
654
- // keep trying to get the slide size if we don't have it yet
655
- curr.cycleH = curr.cycleH || $(curr).height();
656
- curr.cycleW = curr.cycleW || $(curr).width();
657
- next.cycleH = next.cycleH || $(next).height();
658
- next.cycleW = next.cycleW || $(next).width();
659
-
660
- // support multiple transition types
661
- if (opts.multiFx) {
662
- if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length))
663
- opts.lastFx = 0;
664
- else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0))
665
- opts.lastFx = opts.fxs.length - 1;
666
- fx = opts.fxs[opts.lastFx];
667
- }
668
-
669
- // one-time fx overrides apply to: $('div').cycle(3,'zoom');
670
- if (opts.oneTimeFx) {
671
- fx = opts.oneTimeFx;
672
- opts.oneTimeFx = null;
673
- }
674
-
675
- $.fn.cycle.resetState(opts, fx);
676
-
677
- // run the before callbacks
678
- if (opts.before.length)
679
- $.each(opts.before, function(i,o) {
680
- if (p.cycleStop != opts.stopCount) return;
681
- o.apply(next, [curr, next, opts, fwd]);
682
- });
683
-
684
- // stage the after callacks
685
- var after = function() {
686
- opts.busy = 0;
687
- $.each(opts.after, function(i,o) {
688
- if (p.cycleStop != opts.stopCount) return;
689
- o.apply(next, [curr, next, opts, fwd]);
690
- });
691
- if (!p.cycleStop) {
692
- // queue next transition
693
- queueNext();
694
- }
695
- };
696
-
697
- debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
698
-
699
- // get ready to perform the transition
700
- opts.busy = 1;
701
- if (opts.fxFn) // fx function provided?
702
- opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
703
- else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
704
- $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
705
- else
706
- $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
707
- }
708
- else {
709
- queueNext();
710
- }
711
-
712
- if (changed || opts.nextSlide == opts.currSlide) {
713
- // calculate the next slide
714
- var roll;
715
- opts.lastSlide = opts.currSlide;
716
- if (opts.random) {
717
- opts.currSlide = opts.nextSlide;
718
- if (++opts.randomIndex == els.length) {
719
- opts.randomIndex = 0;
720
- opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
721
- }
722
- opts.nextSlide = opts.randomMap[opts.randomIndex];
723
- if (opts.nextSlide == opts.currSlide)
724
- opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
725
- }
726
- else if (opts.backwards) {
727
- roll = (opts.nextSlide - 1) < 0;
728
- if (roll && opts.bounce) {
729
- opts.backwards = !opts.backwards;
730
- opts.nextSlide = 1;
731
- opts.currSlide = 0;
732
- }
733
- else {
734
- opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
735
- opts.currSlide = roll ? 0 : opts.nextSlide+1;
736
- }
737
- }
738
- else { // sequence
739
- roll = (opts.nextSlide + 1) == els.length;
740
- if (roll && opts.bounce) {
741
- opts.backwards = !opts.backwards;
742
- opts.nextSlide = els.length-2;
743
- opts.currSlide = els.length-1;
744
- }
745
- else {
746
- opts.nextSlide = roll ? 0 : opts.nextSlide+1;
747
- opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
748
- }
749
- }
750
- }
751
- if (changed && opts.pager)
752
- opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
753
-
754
- function queueNext() {
755
- // stage the next transition
756
- var ms = 0, timeout = opts.timeout;
757
- if (opts.timeout && !opts.continuous) {
758
- ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
759
- if (opts.fx == 'shuffle')
760
- ms -= opts.speedOut;
761
- }
762
- else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
763
- ms = 10;
764
- if (ms > 0)
765
- p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms);
766
- }
767
- }
768
-
769
- // invoked after transition
770
- $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
771
- $(pager).each(function() {
772
- $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
773
- });
774
- };
775
-
776
- // calculate timeout value for current transition
777
- function getTimeout(curr, next, opts, fwd) {
778
- if (opts.timeoutFn) {
779
- // call user provided calc fn
780
- var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
781
- while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout
782
- t += opts.speed;
783
- debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
784
- if (t !== false)
785
- return t;
786
- }
787
- return opts.timeout;
788
- }
789
-
790
- // expose next/prev function, caller must pass in state
791
- $.fn.cycle.next = function(opts) { advance(opts,1); };
792
- $.fn.cycle.prev = function(opts) { advance(opts,0);};
793
-
794
- // advance slide forward or back
795
- function advance(opts, moveForward) {
796
- var val = moveForward ? 1 : -1;
797
- var els = opts.elements;
798
- var p = opts.$cont[0], timeout = p.cycleTimeout;
799
- if (timeout) {
800
- clearTimeout(timeout);
801
- p.cycleTimeout = 0;
802
- }
803
- if (opts.random && val < 0) {
804
- // move back to the previously display slide
805
- opts.randomIndex--;
806
- if (--opts.randomIndex == -2)
807
- opts.randomIndex = els.length-2;
808
- else if (opts.randomIndex == -1)
809
- opts.randomIndex = els.length-1;
810
- opts.nextSlide = opts.randomMap[opts.randomIndex];
811
- }
812
- else if (opts.random) {
813
- opts.nextSlide = opts.randomMap[opts.randomIndex];
814
- }
815
- else {
816
- opts.nextSlide = opts.currSlide + val;
817
- if (opts.nextSlide < 0) {
818
- if (opts.nowrap) return false;
819
- opts.nextSlide = els.length - 1;
820
- }
821
- else if (opts.nextSlide >= els.length) {
822
- if (opts.nowrap) return false;
823
- opts.nextSlide = 0;
824
- }
825
- }
826
-
827
- var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
828
- if ($.isFunction(cb))
829
- cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
830
- go(els, opts, 1, moveForward);
831
- return false;
832
- }
833
-
834
- function buildPager(els, opts) {
835
- var $p = $(opts.pager);
836
- $.each(els, function(i,o) {
837
- $.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
838
- });
839
- opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
840
- }
841
-
842
- $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
843
- var a;
844
- if ($.isFunction(opts.pagerAnchorBuilder)) {
845
- a = opts.pagerAnchorBuilder(i,el);
846
- debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
847
- }
848
- else
849
- a = '<a href="#">'+(i+1)+'</a>';
850
-
851
- if (!a)
852
- return;
853
- var $a = $(a);
854
- // don't reparent if anchor is in the dom
855
- if ($a.parents('body').length === 0) {
856
- var arr = [];
857
- if ($p.length > 1) {
858
- $p.each(function() {
859
- var $clone = $a.clone(true);
860
- $(this).append($clone);
861
- arr.push($clone[0]);
862
- });
863
- $a = $(arr);
864
- }
865
- else {
866
- $a.appendTo($p);
867
- }
868
- }
869
-
870
- opts.pagerAnchors = opts.pagerAnchors || [];
871
- opts.pagerAnchors.push($a);
872
-
873
- var pagerFn = function(e) {
874
- e.preventDefault();
875
- opts.nextSlide = i;
876
- var p = opts.$cont[0], timeout = p.cycleTimeout;
877
- if (timeout) {
878
- clearTimeout(timeout);
879
- p.cycleTimeout = 0;
880
- }
881
- var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
882
- if ($.isFunction(cb))
883
- cb(opts.nextSlide, els[opts.nextSlide]);
884
- go(els,opts,1,opts.currSlide < i); // trigger the trans
885
- // return false; // <== allow bubble
886
- };
887
-
888
- if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {
889
- $a.hover(pagerFn, function(){/* no-op */} );
890
- }
891
- else {
892
- $a.bind(opts.pagerEvent, pagerFn);
893
- }
894
-
895
- if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
896
- $a.bind('click.cycle', function(){return false;}); // suppress click
897
-
898
- var cont = opts.$cont[0];
899
- var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
900
- if (opts.pauseOnPagerHover) {
901
- $a.hover(
902
- function() {
903
- pauseFlag = true;
904
- cont.cyclePause++;
905
- triggerPause(cont,true,true);
906
- }, function() {
907
- if (pauseFlag)
908
- cont.cyclePause--;
909
- triggerPause(cont,true,true);
910
- }
911
- );
912
- }
913
- };
914
-
915
- // helper fn to calculate the number of slides between the current and the next
916
- $.fn.cycle.hopsFromLast = function(opts, fwd) {
917
- var hops, l = opts.lastSlide, c = opts.currSlide;
918
- if (fwd)
919
- hops = c > l ? c - l : opts.slideCount - l;
920
- else
921
- hops = c < l ? l - c : l + opts.slideCount - c;
922
- return hops;
923
- };
924
-
925
- // fix clearType problems in ie6 by setting an explicit bg color
926
- // (otherwise text slides look horrible during a fade transition)
927
- function clearTypeFix($slides) {
928
- debug('applying clearType background-color hack');
929
- function hex(s) {
930
- s = parseInt(s,10).toString(16);
931
- return s.length < 2 ? '0'+s : s;
932
- }
933
- function getBg(e) {
934
- for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
935
- var v = $.css(e,'background-color');
936
- if (v && v.indexOf('rgb') >= 0 ) {
937
- var rgb = v.match(/\d+/g);
938
- return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
939
- }
940
- if (v && v != 'transparent')
941
- return v;
942
- }
943
- return '#ffffff';
944
- }
945
- $slides.each(function() { $(this).css('background-color', getBg(this)); });
946
- }
947
-
948
- // reset common props before the next transition
949
- $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
950
- $(opts.elements).not(curr).hide();
951
- if (typeof opts.cssBefore.opacity == 'undefined')
952
- opts.cssBefore.opacity = 1;
953
- opts.cssBefore.display = 'block';
954
- if (opts.slideResize && w !== false && next.cycleW > 0)
955
- opts.cssBefore.width = next.cycleW;
956
- if (opts.slideResize && h !== false && next.cycleH > 0)
957
- opts.cssBefore.height = next.cycleH;
958
- opts.cssAfter = opts.cssAfter || {};
959
- opts.cssAfter.display = 'none';
960
- $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
961
- $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
962
- };
963
-
964
- // the actual fn for effecting a transition
965
- $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
966
- var $l = $(curr), $n = $(next);
967
- var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animInDelay = opts.animInDelay, animOutDelay = opts.animOutDelay;
968
- $n.css(opts.cssBefore);
969
- if (speedOverride) {
970
- if (typeof speedOverride == 'number')
971
- speedIn = speedOut = speedOverride;
972
- else
973
- speedIn = speedOut = 1;
974
- easeIn = easeOut = null;
975
- }
976
- var fn = function() {
977
- $n.delay(animInDelay).animate(opts.animIn, speedIn, easeIn, function() {
978
- cb();
979
- });
980
- };
981
- $l.delay(animOutDelay).animate(opts.animOut, speedOut, easeOut, function() {
982
- $l.css(opts.cssAfter);
983
- if (!opts.sync)
984
- fn();
985
- });
986
- if (opts.sync) fn();
987
- };
988
-
989
- // transition definitions - only fade is defined here, transition pack defines the rest
990
- $.fn.cycle.transitions = {
991
- fade: function($cont, $slides, opts) {
992
- $slides.not(':eq('+opts.currSlide+')').css('opacity',0);
993
- opts.before.push(function(curr,next,opts) {
994
- $.fn.cycle.commonReset(curr,next,opts);
995
- opts.cssBefore.opacity = 0;
996
- });
997
- opts.animIn = { opacity: 1 };
998
- opts.animOut = { opacity: 0 };
999
- opts.cssBefore = { top: 0, left: 0 };
1000
- }
1001
- };
1002
-
1003
- $.fn.cycle.ver = function() { return ver; };
1004
-
1005
- // override these globally if you like (they are all optional)
1006
- $.fn.cycle.defaults = {
1007
- activePagerClass: 'activeSlide', // class name used for the active pager link
1008
- after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
1009
- allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
1010
- animIn: null, // properties that define how the slide animates in
1011
- animInDelay: 0, // allows delay before next slide transitions in
1012
- animOut: null, // properties that define how the slide animates out
1013
- animOutDelay: 0, // allows delay before current slide transitions out
1014
- aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option)
1015
- autostop: 0, // true to end slideshow after X transitions (where X == slide count)
1016
- autostopCount: 0, // number of transitions (optionally used with autostop to define X)
1017
- backwards: false, // true to start slideshow at last slide and move backwards through the stack
1018
- before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
1019
- center: null, // set to true to have cycle add top/left margin to each slide (use with width and height options)
1020
- cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE)
1021
- cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
1022
- containerResize: 1, // resize container to fit largest slide
1023
- containerResizeHeight: 0, // resize containers height to fit the largest slide but leave the width dynamic
1024
- continuous: 0, // true to start next transition immediately after current one completes
1025
- cssAfter: null, // properties that defined the state of the slide after transitioning out
1026
- cssBefore: null, // properties that define the initial state of the slide before transitioning in
1027
- delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
1028
- easeIn: null, // easing for "in" transition
1029
- easeOut: null, // easing for "out" transition
1030
- easing: null, // easing method for both in and out transitions
1031
- end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
1032
- fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
1033
- fit: 0, // force slides to fit container
1034
- fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
1035
- fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
1036
- height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well)
1037
- manualTrump: true, // causes manual transition to stop an active transition instead of being ignored
1038
- metaAttr: 'cycle', // data- attribute that holds the option data for the slideshow
1039
- next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide
1040
- nowrap: 0, // true to prevent slideshow from wrapping
1041
- onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
1042
- onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
1043
- pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container
1044
- pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement)
1045
- pagerEvent: 'click.cycle', // name of event which drives the pager navigation
1046
- pause: 0, // true to enable "pause on hover"
1047
- pauseOnPagerHover: 0, // true to pause when hovering over pager link
1048
- prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide
1049
- prevNextEvent: 'click.cycle',// event which drives the manual transition to the previous or next slide
1050
- random: 0, // true for random, false for sequence (not applicable to shuffle fx)
1051
- randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random
1052
- requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
1053
- requeueTimeout: 250, // ms delay for requeue
1054
- rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle)
1055
- shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
1056
- skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
1057
- slideExpr: null, // expression for selecting slides (if something other than all children is required)
1058
- slideResize: 1, // force slide width/height to fixed size before every transition
1059
- speed: 1000, // speed of the transition (any valid fx speed value)
1060
- speedIn: null, // speed of the 'in' transition
1061
- speedOut: null, // speed of the 'out' transition
1062
- startingSlide: undefined,// zero-based index of the first slide to be displayed
1063
- sync: 1, // true if in/out transitions should occur simultaneously
1064
- timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
1065
- timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
1066
- updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style)
1067
- width: null // container width (if the 'fit' option is true, the slides will be set to this width as well)
1068
- };
1069
-
1070
- })(jQuery);
1071
-
1072
-
1073
- /*!
1074
- * jQuery Cycle Plugin Transition Definitions
1075
- * This script is a plugin for the jQuery Cycle Plugin
1076
- * Examples and documentation at: http://malsup.com/jquery/cycle/
1077
- * Copyright (c) 2007-2010 M. Alsup
1078
- * Version: 2.73
1079
- * Dual licensed under the MIT and GPL licenses:
1080
- * http://www.opensource.org/licenses/mit-license.php
1081
- * http://www.gnu.org/licenses/gpl.html
1082
- */
1083
- (function($) {
1084
- "use strict";
1085
-
1086
- //
1087
- // These functions define slide initialization and properties for the named
1088
- // transitions. To save file size feel free to remove any of these that you
1089
- // don't need.
1090
- //
1091
- $.fn.cycle.transitions.none = function($cont, $slides, opts) {
1092
- opts.fxFn = function(curr,next,opts,after){
1093
- $(next).show();
1094
- $(curr).hide();
1095
- after();
1096
- };
1097
- };
1098
-
1099
- // not a cross-fade, fadeout only fades out the top slide
1100
- $.fn.cycle.transitions.fadeout = function($cont, $slides, opts) {
1101
- $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
1102
- opts.before.push(function(curr,next,opts,w,h,rev) {
1103
- $(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0));
1104
- $(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1));
1105
- });
1106
- opts.animIn.opacity = 1;
1107
- opts.animOut.opacity = 0;
1108
- opts.cssBefore.opacity = 1;
1109
- opts.cssBefore.display = 'block';
1110
- opts.cssAfter.zIndex = 0;
1111
- };
1112
-
1113
- // scrollUp/Down/Left/Right
1114
- $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
1115
- $cont.css('overflow','hidden');
1116
- opts.before.push($.fn.cycle.commonReset);
1117
- var h = $cont.height();
1118
- opts.cssBefore.top = h;
1119
- opts.cssBefore.left = 0;
1120
- opts.cssFirst.top = 0;
1121
- opts.animIn.top = 0;
1122
- opts.animOut.top = -h;
1123
- };
1124
- $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
1125
- $cont.css('overflow','hidden');
1126
- opts.before.push($.fn.cycle.commonReset);
1127
- var h = $cont.height();
1128
- opts.cssFirst.top = 0;
1129
- opts.cssBefore.top = -h;
1130
- opts.cssBefore.left = 0;
1131
- opts.animIn.top = 0;
1132
- opts.animOut.top = h;
1133
- };
1134
- $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
1135
- $cont.css('overflow','hidden');
1136
- opts.before.push($.fn.cycle.commonReset);
1137
- var w = $cont.width();
1138
- opts.cssFirst.left = 0;
1139
- opts.cssBefore.left = w;
1140
- opts.cssBefore.top = 0;
1141
- opts.animIn.left = 0;
1142
- opts.animOut.left = 0-w;
1143
- };
1144
- $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
1145
- $cont.css('overflow','hidden');
1146
- opts.before.push($.fn.cycle.commonReset);
1147
- var w = $cont.width();
1148
- opts.cssFirst.left = 0;
1149
- opts.cssBefore.left = -w;
1150
- opts.cssBefore.top = 0;
1151
- opts.animIn.left = 0;
1152
- opts.animOut.left = w;
1153
- };
1154
- $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
1155
- $cont.css('overflow','hidden').width();
1156
- opts.before.push(function(curr, next, opts, fwd) {
1157
- if (opts.rev)
1158
- fwd = !fwd;
1159
- $.fn.cycle.commonReset(curr,next,opts);
1160
- opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
1161
- opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
1162
- });
1163
- opts.cssFirst.left = 0;
1164
- opts.cssBefore.top = 0;
1165
- opts.animIn.left = 0;
1166
- opts.animOut.top = 0;
1167
- };
1168
- $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
1169
- $cont.css('overflow','hidden');
1170
- opts.before.push(function(curr, next, opts, fwd) {
1171
- if (opts.rev)
1172
- fwd = !fwd;
1173
- $.fn.cycle.commonReset(curr,next,opts);
1174
- opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
1175
- opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
1176
- });
1177
- opts.cssFirst.top = 0;
1178
- opts.cssBefore.left = 0;
1179
- opts.animIn.top = 0;
1180
- opts.animOut.left = 0;
1181
- };
1182
-
1183
- // slideX/slideY
1184
- $.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
1185
- opts.before.push(function(curr, next, opts) {
1186
- $(opts.elements).not(curr).hide();
1187
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1188
- opts.animIn.width = next.cycleW;
1189
- });
1190
- opts.cssBefore.left = 0;
1191
- opts.cssBefore.top = 0;
1192
- opts.cssBefore.width = 0;
1193
- opts.animIn.width = 'show';
1194
- opts.animOut.width = 0;
1195
- };
1196
- $.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
1197
- opts.before.push(function(curr, next, opts) {
1198
- $(opts.elements).not(curr).hide();
1199
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1200
- opts.animIn.height = next.cycleH;
1201
- });
1202
- opts.cssBefore.left = 0;
1203
- opts.cssBefore.top = 0;
1204
- opts.cssBefore.height = 0;
1205
- opts.animIn.height = 'show';
1206
- opts.animOut.height = 0;
1207
- };
1208
-
1209
- // shuffle
1210
- $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
1211
- var i, w = $cont.css('overflow', 'visible').width();
1212
- $slides.css({left: 0, top: 0});
1213
- opts.before.push(function(curr,next,opts) {
1214
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1215
- });
1216
- // only adjust speed once!
1217
- if (!opts.speedAdjusted) {
1218
- opts.speed = opts.speed / 2; // shuffle has 2 transitions
1219
- opts.speedAdjusted = true;
1220
- }
1221
- opts.random = 0;
1222
- opts.shuffle = opts.shuffle || {left:-w, top:15};
1223
- opts.els = [];
1224
- for (i=0; i < $slides.length; i++)
1225
- opts.els.push($slides[i]);
1226
-
1227
- for (i=0; i < opts.currSlide; i++)
1228
- opts.els.push(opts.els.shift());
1229
-
1230
- // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1231
- opts.fxFn = function(curr, next, opts, cb, fwd) {
1232
- if (opts.rev)
1233
- fwd = !fwd;
1234
- var $el = fwd ? $(curr) : $(next);
1235
- $(next).css(opts.cssBefore);
1236
- var count = opts.slideCount;
1237
- $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1238
- var hops = $.fn.cycle.hopsFromLast(opts, fwd);
1239
- for (var k=0; k < hops; k++) {
1240
- if (fwd)
1241
- opts.els.push(opts.els.shift());
1242
- else
1243
- opts.els.unshift(opts.els.pop());
1244
- }
1245
- if (fwd) {
1246
- for (var i=0, len=opts.els.length; i < len; i++)
1247
- $(opts.els[i]).css('z-index', len-i+count);
1248
- }
1249
- else {
1250
- var z = $(curr).css('z-index');
1251
- $el.css('z-index', parseInt(z,10)+1+count);
1252
- }
1253
- $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1254
- $(fwd ? this : curr).hide();
1255
- if (cb) cb();
1256
- });
1257
- });
1258
- };
1259
- $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1260
- };
1261
-
1262
- // turnUp/Down/Left/Right
1263
- $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
1264
- opts.before.push(function(curr, next, opts) {
1265
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1266
- opts.cssBefore.top = next.cycleH;
1267
- opts.animIn.height = next.cycleH;
1268
- opts.animOut.width = next.cycleW;
1269
- });
1270
- opts.cssFirst.top = 0;
1271
- opts.cssBefore.left = 0;
1272
- opts.cssBefore.height = 0;
1273
- opts.animIn.top = 0;
1274
- opts.animOut.height = 0;
1275
- };
1276
- $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
1277
- opts.before.push(function(curr, next, opts) {
1278
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1279
- opts.animIn.height = next.cycleH;
1280
- opts.animOut.top = curr.cycleH;
1281
- });
1282
- opts.cssFirst.top = 0;
1283
- opts.cssBefore.left = 0;
1284
- opts.cssBefore.top = 0;
1285
- opts.cssBefore.height = 0;
1286
- opts.animOut.height = 0;
1287
- };
1288
- $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
1289
- opts.before.push(function(curr, next, opts) {
1290
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1291
- opts.cssBefore.left = next.cycleW;
1292
- opts.animIn.width = next.cycleW;
1293
- });
1294
- opts.cssBefore.top = 0;
1295
- opts.cssBefore.width = 0;
1296
- opts.animIn.left = 0;
1297
- opts.animOut.width = 0;
1298
- };
1299
- $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
1300
- opts.before.push(function(curr, next, opts) {
1301
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1302
- opts.animIn.width = next.cycleW;
1303
- opts.animOut.left = curr.cycleW;
1304
- });
1305
- $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
1306
- opts.animIn.left = 0;
1307
- opts.animOut.width = 0;
1308
- };
1309
-
1310
- // zoom
1311
- $.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
1312
- opts.before.push(function(curr, next, opts) {
1313
- $.fn.cycle.commonReset(curr,next,opts,false,false,true);
1314
- opts.cssBefore.top = next.cycleH/2;
1315
- opts.cssBefore.left = next.cycleW/2;
1316
- $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1317
- $.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 });
1318
- });
1319
- opts.cssFirst.top = 0;
1320
- opts.cssFirst.left = 0;
1321
- opts.cssBefore.width = 0;
1322
- opts.cssBefore.height = 0;
1323
- };
1324
-
1325
- // fadeZoom
1326
- $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
1327
- opts.before.push(function(curr, next, opts) {
1328
- $.fn.cycle.commonReset(curr,next,opts,false,false);
1329
- opts.cssBefore.left = next.cycleW/2;
1330
- opts.cssBefore.top = next.cycleH/2;
1331
- $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1332
- });
1333
- opts.cssBefore.width = 0;
1334
- opts.cssBefore.height = 0;
1335
- opts.animOut.opacity = 0;
1336
- };
1337
-
1338
- // blindX
1339
- $.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
1340
- var w = $cont.css('overflow','hidden').width();
1341
- opts.before.push(function(curr, next, opts) {
1342
- $.fn.cycle.commonReset(curr,next,opts);
1343
- opts.animIn.width = next.cycleW;
1344
- opts.animOut.left = curr.cycleW;
1345
- });
1346
- opts.cssBefore.left = w;
1347
- opts.cssBefore.top = 0;
1348
- opts.animIn.left = 0;
1349
- opts.animOut.left = w;
1350
- };
1351
- // blindY
1352
- $.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
1353
- var h = $cont.css('overflow','hidden').height();
1354
- opts.before.push(function(curr, next, opts) {
1355
- $.fn.cycle.commonReset(curr,next,opts);
1356
- opts.animIn.height = next.cycleH;
1357
- opts.animOut.top = curr.cycleH;
1358
- });
1359
- opts.cssBefore.top = h;
1360
- opts.cssBefore.left = 0;
1361
- opts.animIn.top = 0;
1362
- opts.animOut.top = h;
1363
- };
1364
- // blindZ
1365
- $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
1366
- var h = $cont.css('overflow','hidden').height();
1367
- var w = $cont.width();
1368
- opts.before.push(function(curr, next, opts) {
1369
- $.fn.cycle.commonReset(curr,next,opts);
1370
- opts.animIn.height = next.cycleH;
1371
- opts.animOut.top = curr.cycleH;
1372
- });
1373
- opts.cssBefore.top = h;
1374
- opts.cssBefore.left = w;
1375
- opts.animIn.top = 0;
1376
- opts.animIn.left = 0;
1377
- opts.animOut.top = h;
1378
- opts.animOut.left = w;
1379
- };
1380
-
1381
- // growX - grow horizontally from centered 0 width
1382
- $.fn.cycle.transitions.growX = function($cont, $slides, opts) {
1383
- opts.before.push(function(curr, next, opts) {
1384
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1385
- opts.cssBefore.left = this.cycleW/2;
1386
- opts.animIn.left = 0;
1387
- opts.animIn.width = this.cycleW;
1388
- opts.animOut.left = 0;
1389
- });
1390
- opts.cssBefore.top = 0;
1391
- opts.cssBefore.width = 0;
1392
- };
1393
- // growY - grow vertically from centered 0 height
1394
- $.fn.cycle.transitions.growY = function($cont, $slides, opts) {
1395
- opts.before.push(function(curr, next, opts) {
1396
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1397
- opts.cssBefore.top = this.cycleH/2;
1398
- opts.animIn.top = 0;
1399
- opts.animIn.height = this.cycleH;
1400
- opts.animOut.top = 0;
1401
- });
1402
- opts.cssBefore.height = 0;
1403
- opts.cssBefore.left = 0;
1404
- };
1405
-
1406
- // curtainX - squeeze in both edges horizontally
1407
- $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
1408
- opts.before.push(function(curr, next, opts) {
1409
- $.fn.cycle.commonReset(curr,next,opts,false,true,true);
1410
- opts.cssBefore.left = next.cycleW/2;
1411
- opts.animIn.left = 0;
1412
- opts.animIn.width = this.cycleW;
1413
- opts.animOut.left = curr.cycleW/2;
1414
- opts.animOut.width = 0;
1415
- });
1416
- opts.cssBefore.top = 0;
1417
- opts.cssBefore.width = 0;
1418
- };
1419
- // curtainY - squeeze in both edges vertically
1420
- $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
1421
- opts.before.push(function(curr, next, opts) {
1422
- $.fn.cycle.commonReset(curr,next,opts,true,false,true);
1423
- opts.cssBefore.top = next.cycleH/2;
1424
- opts.animIn.top = 0;
1425
- opts.animIn.height = next.cycleH;
1426
- opts.animOut.top = curr.cycleH/2;
1427
- opts.animOut.height = 0;
1428
- });
1429
- opts.cssBefore.height = 0;
1430
- opts.cssBefore.left = 0;
1431
- };
1432
-
1433
- // cover - curr slide covered by next slide
1434
- $.fn.cycle.transitions.cover = function($cont, $slides, opts) {
1435
- var d = opts.direction || 'left';
1436
- var w = $cont.css('overflow','hidden').width();
1437
- var h = $cont.height();
1438
- opts.before.push(function(curr, next, opts) {
1439
- $.fn.cycle.commonReset(curr,next,opts);
1440
- opts.cssAfter.display = '';
1441
- if (d == 'right')
1442
- opts.cssBefore.left = -w;
1443
- else if (d == 'up')
1444
- opts.cssBefore.top = h;
1445
- else if (d == 'down')
1446
- opts.cssBefore.top = -h;
1447
- else
1448
- opts.cssBefore.left = w;
1449
- });
1450
- opts.animIn.left = 0;
1451
- opts.animIn.top = 0;
1452
- opts.cssBefore.top = 0;
1453
- opts.cssBefore.left = 0;
1454
- };
1455
-
1456
- // uncover - curr slide moves off next slide
1457
- $.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
1458
- var d = opts.direction || 'left';
1459
- var w = $cont.css('overflow','hidden').width();
1460
- var h = $cont.height();
1461
- opts.before.push(function(curr, next, opts) {
1462
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1463
- if (d == 'right')
1464
- opts.animOut.left = w;
1465
- else if (d == 'up')
1466
- opts.animOut.top = -h;
1467
- else if (d == 'down')
1468
- opts.animOut.top = h;
1469
- else
1470
- opts.animOut.left = -w;
1471
- });
1472
- opts.animIn.left = 0;
1473
- opts.animIn.top = 0;
1474
- opts.cssBefore.top = 0;
1475
- opts.cssBefore.left = 0;
1476
- };
1477
-
1478
- // toss - move top slide and fade away
1479
- $.fn.cycle.transitions.toss = function($cont, $slides, opts) {
1480
- var w = $cont.css('overflow','visible').width();
1481
- var h = $cont.height();
1482
- opts.before.push(function(curr, next, opts) {
1483
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1484
- // provide default toss settings if animOut not provided
1485
- if (!opts.animOut.left && !opts.animOut.top)
1486
- $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
1487
- else
1488
- opts.animOut.opacity = 0;
1489
- });
1490
- opts.cssBefore.left = 0;
1491
- opts.cssBefore.top = 0;
1492
- opts.animIn.left = 0;
1493
- };
1494
-
1495
- // wipe - clip animation
1496
- $.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
1497
- var w = $cont.css('overflow','hidden').width();
1498
- var h = $cont.height();
1499
- opts.cssBefore = opts.cssBefore || {};
1500
- var clip;
1501
- if (opts.clip) {
1502
- if (/l2r/.test(opts.clip))
1503
- clip = 'rect(0px 0px '+h+'px 0px)';
1504
- else if (/r2l/.test(opts.clip))
1505
- clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
1506
- else if (/t2b/.test(opts.clip))
1507
- clip = 'rect(0px '+w+'px 0px 0px)';
1508
- else if (/b2t/.test(opts.clip))
1509
- clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
1510
- else if (/zoom/.test(opts.clip)) {
1511
- var top = parseInt(h/2,10);
1512
- var left = parseInt(w/2,10);
1513
- clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
1514
- }
1515
- }
1516
-
1517
- opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
1518
-
1519
- var d = opts.cssBefore.clip.match(/(\d+)/g);
1520
- var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
1521
-
1522
- opts.before.push(function(curr, next, opts) {
1523
- if (curr == next) return;
1524
- var $curr = $(curr), $next = $(next);
1525
- $.fn.cycle.commonReset(curr,next,opts,true,true,false);
1526
- opts.cssAfter.display = 'block';
1527
-
1528
- var step = 1, count = parseInt((opts.speedIn / 13),10) - 1;
1529
- (function f() {
1530
- var tt = t ? t - parseInt(step * (t/count),10) : 0;
1531
- var ll = l ? l - parseInt(step * (l/count),10) : 0;
1532
- var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h;
1533
- var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w;
1534
- $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
1535
- (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
1536
- })();
1537
- });
1538
- $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1539
- opts.animIn = { left: 0 };
1540
- opts.animOut = { left: 0 };
1541
- };
1542
-
1543
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/smooth.js CHANGED
@@ -1,56 +1,1544 @@
1
- ;(function($) {
2
- jQuery.fn.smoothSlider=function(args){
3
- var defaults={
4
- sliderWidth :900,
5
- sliderHeight :320,
6
- navArr :0,
7
- img_align :'left'
8
- }
9
- options=jQuery.extend({},defaults,args);
10
- var self=this;
11
- this.smoothSliderSize=function(){
12
- var wrapWidth=this.width();
13
- var slideri=this.find('.smooth_slideri');
14
- var slideriW;
15
- //calculate max-width of slideri
16
- if(options.navArr==0) slideriW=wrapWidth;
17
- else slideriW=wrapWidth-(48+10); //48px for arrows and 10 for additional margin for text
18
- slideri.css('max-width',slideriW+'px');
19
- //float excerpt below image
20
- if(options.img_align=='left' || options.img_align=='right'){
21
- var sldrThumb=this.find('.smooth_slider_thumbnail');
22
- var sldrThumbW=sldrThumb.outerWidth(true);
23
- if(slideriW-sldrThumbW < 70){
24
- if(options.img_align=='right')sldrThumb.removeClass('smoothRight');
25
- else sldrThumb.removeClass('smoothLeft');
26
- sldrThumb.addClass('smoothNone');
27
- }
28
- else{
29
- sldrThumb.removeClass('smoothNone');
30
- if(options.img_align=='right')sldrThumb.addClass('smoothRight');
31
- else sldrThumb.addClass('smoothLeft');
32
- }
33
- }
34
- //slider height
35
- var iht=0;
36
- this.find(".smooth_slideri").each(function(idx,el){
37
- if(jQuery(el).outerHeight(true)>iht)iht=jQuery(el).outerHeight(true);
38
- });
39
- var eHt=this.find(".sldr_title").outerHeight(true) + this.find(".smooth_nav").outerHeight(true);
40
- var ht=iht + eHt;
41
- this.height(ht);
42
- this.find(".smooth_slider_thumbnail").on('load',function(e){
43
- var pHt=jQuery(this).parents(".smooth_slideri").outerHeight(true)+eHt;
44
- if(pHt > ht)ht=pHt;
45
- self.height(ht);
46
- });
47
- return this;
48
- };
49
- this.smoothSliderSize();
50
-
51
- //On Window Resize
52
- jQuery(window).resize(function() {
53
- self.smoothSliderSize();
54
- });
55
- }
56
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Modifications for Smooth Slider
3
+ * jQuery Cycle Plugin (with Transition Definitions)
4
+ * Examples and documentation at: http://jquery.malsup.com/smooth/
5
+ * Copyright (c) 2007-2013 M. Alsup
6
+ * Version: 3.0.3 (11-JUL-2013)
7
+ * Dual licensed under the MIT and GPL licenses.
8
+ * http://jquery.malsup.com/license.html
9
+ * Requires: jQuery v1.7.1 or later
10
+ */
11
+ ;(function($, undefined) {
12
+ "use strict";
13
+
14
+ var ver = '3.0.3';
15
+
16
+ function debug(s) {
17
+ if ($.fn.smooth.debug)
18
+ log(s);
19
+ }
20
+ function log() {
21
+ /*global console */
22
+ if (window.console && console.log)
23
+ console.log('[smooth] ' + Array.prototype.join.call(arguments,' '));
24
+ }
25
+ $.expr[':'].paused = function(el) {
26
+ return el.smoothPause;
27
+ };
28
+
29
+
30
+ // the options arg can be...
31
+ // a number - indicates an immediate transition should occur to the given slide index
32
+ // a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
33
+ // an object - properties to control the slideshow
34
+ //
35
+ // the arg2 arg can be...
36
+ // the name of an fx (only used in conjunction with a numeric value for 'options')
37
+ // the value true (only used in first arg == 'resume') and indicates
38
+ // that the resume should occur immediately (not wait for next timeout)
39
+
40
+ $.fn.smooth = function(options, arg2) {
41
+ var o = { s: this.selector, c: this.context };
42
+
43
+ // in 1.3+ we can fix mistakes with the ready state
44
+ if (this.length === 0 && options != 'stop') {
45
+ if (!$.isReady && o.s) {
46
+ log('DOM not ready, queuing slideshow');
47
+ $(function() {
48
+ $(o.s,o.c).smooth(options,arg2);
49
+ });
50
+ return this;
51
+ }
52
+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
53
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
54
+ return this;
55
+ }
56
+
57
+ // iterate the matched nodeset
58
+ return this.each(function() {
59
+ var opts = handleArguments(this, options, arg2);
60
+ if (opts === false)
61
+ return;
62
+
63
+ opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.smooth.updateActivePagerLink;
64
+
65
+ // stop existing slideshow for this container (if there is one)
66
+ if (this.smoothTimeout)
67
+ clearTimeout(this.smoothTimeout);
68
+ this.smoothTimeout = this.smoothPause = 0;
69
+ this.smoothStop = 0; // issue #108
70
+
71
+ var $cont = $(this);
72
+ var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
73
+ var els = $slides.get();
74
+
75
+ if (els.length < 2) {
76
+ log('terminating; too few slides: ' + els.length);
77
+ return;
78
+ }
79
+
80
+ var opts2 = buildOptions($cont, $slides, els, opts, o);
81
+ if (opts2 === false)
82
+ return;
83
+
84
+ var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
85
+
86
+ // if it's an auto slideshow, kick it off
87
+ if (startTime) {
88
+ startTime += (opts2.delay || 0);
89
+ if (startTime < 10)
90
+ startTime = 10;
91
+ debug('first timeout: ' + startTime);
92
+ this.smoothTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime);
93
+ }
94
+ });
95
+ };
96
+
97
+ function triggerPause(cont, byHover, onPager) {
98
+ var opts = $(cont).data('smooth.opts');
99
+ if (!opts)
100
+ return;
101
+ var paused = !!cont.smoothPause;
102
+ if (paused && opts.paused)
103
+ opts.paused(cont, opts, byHover, onPager);
104
+ else if (!paused && opts.resumed)
105
+ opts.resumed(cont, opts, byHover, onPager);
106
+ }
107
+
108
+ // process the args that were passed to the plugin fn
109
+ function handleArguments(cont, options, arg2) {
110
+ if (cont.smoothStop === undefined)
111
+ cont.smoothStop = 0;
112
+ if (options === undefined || options === null)
113
+ options = {};
114
+ if (options.constructor == String) {
115
+ switch(options) {
116
+ case 'destroy':
117
+ case 'stop':
118
+ var opts = $(cont).data('smooth.opts');
119
+ if (!opts)
120
+ return false;
121
+ cont.smoothStop++; // callbacks look for change
122
+ if (cont.smoothTimeout)
123
+ clearTimeout(cont.smoothTimeout);
124
+ cont.smoothTimeout = 0;
125
+ if (opts.elements)
126
+ $(opts.elements).stop();
127
+ $(cont).removeData('smooth.opts');
128
+ if (options == 'destroy')
129
+ destroy(cont, opts);
130
+ return false;
131
+ case 'toggle':
132
+ cont.smoothPause = (cont.smoothPause === 1) ? 0 : 1;
133
+ checkInstantResume(cont.smoothPause, arg2, cont);
134
+ triggerPause(cont);
135
+ return false;
136
+ case 'pause':
137
+ cont.smoothPause = 1;
138
+ triggerPause(cont);
139
+ return false;
140
+ case 'resume':
141
+ cont.smoothPause = 0;
142
+ checkInstantResume(false, arg2, cont);
143
+ triggerPause(cont);
144
+ return false;
145
+ case 'prev':
146
+ case 'next':
147
+ opts = $(cont).data('smooth.opts');
148
+ if (!opts) {
149
+ log('options not found, "prev/next" ignored');
150
+ return false;
151
+ }
152
+ if (typeof arg2 == 'string')
153
+ opts.oneTimeFx = arg2;
154
+ $.fn.smooth[options](opts);
155
+ return false;
156
+ default:
157
+ options = { fx: options };
158
+ }
159
+ return options;
160
+ }
161
+ else if (options.constructor == Number) {
162
+ // go to the requested slide
163
+ var num = options;
164
+ options = $(cont).data('smooth.opts');
165
+ if (!options) {
166
+ log('options not found, can not advance slide');
167
+ return false;
168
+ }
169
+ if (num < 0 || num >= options.elements.length) {
170
+ log('invalid slide index: ' + num);
171
+ return false;
172
+ }
173
+ options.nextSlide = num;
174
+ if (cont.smoothTimeout) {
175
+ clearTimeout(cont.smoothTimeout);
176
+ cont.smoothTimeout = 0;
177
+ }
178
+ if (typeof arg2 == 'string')
179
+ options.oneTimeFx = arg2;
180
+ go(options.elements, options, 1, num >= options.currSlide);
181
+ return false;
182
+ }
183
+ return options;
184
+
185
+ function checkInstantResume(isPaused, arg2, cont) {
186
+ if (!isPaused && arg2 === true) { // resume now!
187
+ var options = $(cont).data('smooth.opts');
188
+ if (!options) {
189
+ log('options not found, can not resume');
190
+ return false;
191
+ }
192
+ if (cont.smoothTimeout) {
193
+ clearTimeout(cont.smoothTimeout);
194
+ cont.smoothTimeout = 0;
195
+ }
196
+ go(options.elements, options, 1, !options.backwards);
197
+ }
198
+ }
199
+ }
200
+
201
+ function removeFilter(el, opts) {
202
+ if (!$.support.opacity && opts.cleartype && el.style.filter) {
203
+ try { el.style.removeAttribute('filter'); }
204
+ catch(smother) {} // handle old opera versions
205
+ }
206
+ }
207
+
208
+ // unbind event handlers
209
+ function destroy(cont, opts) {
210
+ if (opts.next)
211
+ $(opts.next).unbind(opts.prevNextEvent);
212
+ if (opts.prev)
213
+ $(opts.prev).unbind(opts.prevNextEvent);
214
+
215
+ if (opts.pager || opts.pagerAnchorBuilder)
216
+ $.each(opts.pagerAnchors || [], function() {
217
+ this.unbind().remove();
218
+ });
219
+ opts.pagerAnchors = null;
220
+ $(cont).unbind('mouseenter.smooth mouseleave.smooth');
221
+ if (opts.destroy) // callback
222
+ opts.destroy(opts);
223
+ }
224
+
225
+ // one-time initialization
226
+ function buildOptions($cont, $slides, els, options, o) {
227
+ var startingSlideSpecified;
228
+ // support metadata plugin (v1.0 and v2.0)
229
+ var opts = $.extend({}, $.fn.smooth.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
230
+ var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
231
+ if (meta)
232
+ opts = $.extend(opts, meta);
233
+ if (opts.autostop)
234
+ opts.countdown = opts.autostopCount || els.length;
235
+
236
+ var cont = $cont[0];
237
+ $cont.data('smooth.opts', opts);
238
+ opts.$cont = $cont;
239
+ opts.stopCount = cont.smoothStop;
240
+ opts.elements = els;
241
+ opts.before = opts.before ? [opts.before] : [];
242
+ opts.after = opts.after ? [opts.after] : [];
243
+
244
+ // push some after callbacks
245
+ if (!$.support.opacity && opts.cleartype)
246
+ opts.after.push(function() { removeFilter(this, opts); });
247
+ if (opts.continuous)
248
+ opts.after.push(function() { go(els,opts,0,!opts.backwards); });
249
+
250
+ saveOriginalOpts(opts);
251
+
252
+ // clearType corrections
253
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
254
+ clearTypeFix($slides);
255
+
256
+ // container requires non-static position so that slides can be position within
257
+ if ($cont.css('position') == 'static')
258
+ $cont.css('position', 'relative');
259
+ if (opts.width)
260
+ $cont.width(opts.width);
261
+ if (opts.height && opts.height != 'auto')
262
+ $cont.height(opts.height);
263
+
264
+ if (opts.startingSlide !== undefined) {
265
+ opts.startingSlide = parseInt(opts.startingSlide,10);
266
+ if (opts.startingSlide >= els.length || opts.startSlide < 0)
267
+ opts.startingSlide = 0; // catch bogus input
268
+ else
269
+ startingSlideSpecified = true;
270
+ }
271
+ else if (opts.backwards)
272
+ opts.startingSlide = els.length - 1;
273
+ else
274
+ opts.startingSlide = 0;
275
+
276
+ // if random, mix up the slide array
277
+ if (opts.random) {
278
+ opts.randomMap = [];
279
+ for (var i = 0; i < els.length; i++)
280
+ opts.randomMap.push(i);
281
+ opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
282
+ if (startingSlideSpecified) {
283
+ // try to find the specified starting slide and if found set start slide index in the map accordingly
284
+ for ( var cnt = 0; cnt < els.length; cnt++ ) {
285
+ if ( opts.startingSlide == opts.randomMap[cnt] ) {
286
+ opts.randomIndex = cnt;
287
+ }
288
+ }
289
+ }
290
+ else {
291
+ opts.randomIndex = 1;
292
+ opts.startingSlide = opts.randomMap[1];
293
+ }
294
+ }
295
+ else if (opts.startingSlide >= els.length)
296
+ opts.startingSlide = 0; // catch bogus input
297
+ opts.currSlide = opts.startingSlide || 0;
298
+ var first = opts.startingSlide;
299
+
300
+ // set position and zIndex on all the slides
301
+ $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
302
+ var z;
303
+ if (opts.backwards)
304
+ z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
305
+ else
306
+ z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
307
+ $(this).css('z-index', z);
308
+ });
309
+
310
+ // make sure first slide is visible
311
+ $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
312
+ removeFilter(els[first], opts);
313
+
314
+ // stretch slides
315
+ if (opts.fit) {
316
+ if (!opts.aspect) {
317
+ if (opts.width)
318
+ $slides.width(opts.width);
319
+ if (opts.height && opts.height != 'auto')
320
+ $slides.height(opts.height);
321
+ } else {
322
+ $slides.each(function(){
323
+ var $slide = $(this);
324
+ var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect;
325
+ if( opts.width && $slide.width() != opts.width ) {
326
+ $slide.width( opts.width );
327
+ $slide.height( opts.width / ratio );
328
+ }
329
+
330
+ if( opts.height && $slide.height() < opts.height ) {
331
+ $slide.height( opts.height );
332
+ $slide.width( opts.height * ratio );
333
+ }
334
+ });
335
+ }
336
+ }
337
+
338
+ if (opts.center && ((!opts.fit) || opts.aspect)) {
339
+ $slides.each(function(){
340
+ var $slide = $(this);
341
+ $slide.css({
342
+ "margin-left": opts.width ?
343
+ ((opts.width - $slide.width()) / 2) + "px" :
344
+ 0,
345
+ "margin-top": opts.height ?
346
+ ((opts.height - $slide.height()) / 2) + "px" :
347
+ 0
348
+ });
349
+ });
350
+ }
351
+
352
+ if (opts.center && !opts.fit && !opts.slideResize) {
353
+ $slides.each(function(){
354
+ var $slide = $(this);
355
+ $slide.css({
356
+ "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0,
357
+ "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0
358
+ });
359
+ });
360
+ }
361
+
362
+ // stretch container
363
+ var reshape = (opts.containerResize || opts.containerResizeHeight) && $cont.innerHeight() < 1;
364
+ if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
365
+ var maxw = 0, maxh = 0;
366
+ for(var j=0; j < els.length; j++) {
367
+ var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
368
+ if (!w) w = e.offsetWidth || e.width || $e.attr('width');
369
+ if (!h) h = e.offsetHeight || e.height || $e.attr('height');
370
+ maxw = w > maxw ? w : maxw;
371
+ maxh = h > maxh ? h : maxh;
372
+ }
373
+ if (opts.containerResize && maxw > 0 && maxh > 0)
374
+ $cont.css({width:maxw+'px',height:maxh+'px'});
375
+ if (opts.containerResizeHeight && maxh > 0)
376
+ $cont.css({height:maxh+'px'});
377
+ }
378
+
379
+ var pauseFlag = false; // https://github.com/malsup/smooth/issues/44
380
+ if (opts.pause)
381
+ $cont.bind('mouseenter.smooth', function(){
382
+ pauseFlag = true;
383
+ this.smoothPause++;
384
+ triggerPause(cont, true);
385
+ }).bind('mouseleave.smooth', function(){
386
+ if (pauseFlag)
387
+ this.smoothPause--;
388
+ triggerPause(cont, true);
389
+ });
390
+
391
+ if (supportMultiTransitions(opts) === false)
392
+ return false;
393
+
394
+ // apparently a lot of people use image slideshows without height/width attributes on the images.
395
+ // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
396
+ var requeue = false;
397
+ options.requeueAttempts = options.requeueAttempts || 0;
398
+ $slides.each(function() {
399
+ // try to get height/width of each slide
400
+ var $el = $(this);
401
+ this.smoothH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
402
+ this.smoothW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
403
+
404
+ if ( $el.is('img') ) {
405
+ var loading = (this.smoothH === 0 && this.smoothW === 0 && !this.complete);
406
+ // don't requeue for images that are still loading but have a valid size
407
+ if (loading) {
408
+ if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
409
+ log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.smoothW, this.smoothH);
410
+ setTimeout(function() {$(o.s,o.c).smooth(options);}, opts.requeueTimeout);
411
+ requeue = true;
412
+ return false; // break each loop
413
+ }
414
+ else {
415
+ log('could not determine size of image: '+this.src, this.smoothW, this.smoothH);
416
+ }
417
+ }
418
+ }
419
+ return true;
420
+ });
421
+
422
+ if (requeue)
423
+ return false;
424
+
425
+ opts.cssBefore = opts.cssBefore || {};
426
+ opts.cssAfter = opts.cssAfter || {};
427
+ opts.cssFirst = opts.cssFirst || {};
428
+ opts.animIn = opts.animIn || {};
429
+ opts.animOut = opts.animOut || {};
430
+
431
+ $slides.not(':eq('+first+')').css(opts.cssBefore);
432
+ $($slides[first]).css(opts.cssFirst);
433
+
434
+ if (opts.timeout) {
435
+ opts.timeout = parseInt(opts.timeout,10);
436
+ // ensure that timeout and speed settings are sane
437
+ if (opts.speed.constructor == String)
438
+ opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10);
439
+ if (!opts.sync)
440
+ opts.speed = opts.speed / 2;
441
+
442
+ var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250;
443
+ while((opts.timeout - opts.speed) < buffer) // sanitize timeout
444
+ opts.timeout += opts.speed;
445
+ }
446
+ if (opts.easing)
447
+ opts.easeIn = opts.easeOut = opts.easing;
448
+ if (!opts.speedIn)
449
+ opts.speedIn = opts.speed;
450
+ if (!opts.speedOut)
451
+ opts.speedOut = opts.speed;
452
+
453
+ opts.slideCount = els.length;
454
+ opts.currSlide = opts.lastSlide = first;
455
+ if (opts.random) {
456
+ if (++opts.randomIndex == els.length)
457
+ opts.randomIndex = 0;
458
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
459
+ }
460
+ else if (opts.backwards)
461
+ opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1;
462
+ else
463
+ opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
464
+
465
+ // run transition init fn
466
+ if (!opts.multiFx) {
467
+ var init = $.fn.smooth.transitions[opts.fx];
468
+ if ($.isFunction(init))
469
+ init($cont, $slides, opts);
470
+ else if (opts.fx != 'custom' && !opts.multiFx) {
471
+ log('unknown transition: ' + opts.fx,'; slideshow terminating');
472
+ return false;
473
+ }
474
+ }
475
+
476
+ // fire artificial events
477
+ var e0 = $slides[first];
478
+ if (!opts.skipInitializationCallbacks) {
479
+ if (opts.before.length)
480
+ opts.before[0].apply(e0, [e0, e0, opts, true]);
481
+ if (opts.after.length)
482
+ opts.after[0].apply(e0, [e0, e0, opts, true]);
483
+ }
484
+ if (opts.next)
485
+ $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});
486
+ if (opts.prev)
487
+ $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});
488
+ if (opts.pager || opts.pagerAnchorBuilder)
489
+ buildPager(els,opts);
490
+
491
+ exposeAddSlide(opts, els);
492
+
493
+ return opts;
494
+ }
495
+
496
+ // save off original opts so we can restore after clearing state
497
+ function saveOriginalOpts(opts) {
498
+ opts.original = { before: [], after: [] };
499
+ opts.original.cssBefore = $.extend({}, opts.cssBefore);
500
+ opts.original.cssAfter = $.extend({}, opts.cssAfter);
501
+ opts.original.animIn = $.extend({}, opts.animIn);
502
+ opts.original.animOut = $.extend({}, opts.animOut);
503
+ $.each(opts.before, function() { opts.original.before.push(this); });
504
+ $.each(opts.after, function() { opts.original.after.push(this); });
505
+ }
506
+
507
+ function supportMultiTransitions(opts) {
508
+ var i, tx, txs = $.fn.smooth.transitions;
509
+ // look for multiple effects
510
+ if (opts.fx.indexOf(',') > 0) {
511
+ opts.multiFx = true;
512
+ opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
513
+ // discard any bogus effect names
514
+ for (i=0; i < opts.fxs.length; i++) {
515
+ var fx = opts.fxs[i];
516
+ tx = txs[fx];
517
+ if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
518
+ log('discarding unknown transition: ',fx);
519
+ opts.fxs.splice(i,1);
520
+ i--;
521
+ }
522
+ }
523
+ // if we have an empty list then we threw everything away!
524
+ if (!opts.fxs.length) {
525
+ log('No valid transitions named; slideshow terminating.');
526
+ return false;
527
+ }
528
+ }
529
+ else if (opts.fx == 'all') { // auto-gen the list of transitions
530
+ opts.multiFx = true;
531
+ opts.fxs = [];
532
+ for (var p in txs) {
533
+ if (txs.hasOwnProperty(p)) {
534
+ tx = txs[p];
535
+ if (txs.hasOwnProperty(p) && $.isFunction(tx))
536
+ opts.fxs.push(p);
537
+ }
538
+ }
539
+ }
540
+ if (opts.multiFx && opts.randomizeEffects) {
541
+ // munge the fxs array to make effect selection random
542
+ var r1 = Math.floor(Math.random() * 20) + 30;
543
+ for (i = 0; i < r1; i++) {
544
+ var r2 = Math.floor(Math.random() * opts.fxs.length);
545
+ opts.fxs.push(opts.fxs.splice(r2,1)[0]);
546
+ }
547
+ debug('randomized fx sequence: ',opts.fxs);
548
+ }
549
+ return true;
550
+ }
551
+
552
+ // provide a mechanism for adding slides after the slideshow has started
553
+ function exposeAddSlide(opts, els) {
554
+ opts.addSlide = function(newSlide, prepend) {
555
+ var $s = $(newSlide), s = $s[0];
556
+ if (!opts.autostopCount)
557
+ opts.countdown++;
558
+ els[prepend?'unshift':'push'](s);
559
+ if (opts.els)
560
+ opts.els[prepend?'unshift':'push'](s); // shuffle needs this
561
+ opts.slideCount = els.length;
562
+
563
+ // add the slide to the random map and resort
564
+ if (opts.random) {
565
+ opts.randomMap.push(opts.slideCount-1);
566
+ opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
567
+ }
568
+
569
+ $s.css('position','absolute');
570
+ $s[prepend?'prependTo':'appendTo'](opts.$cont);
571
+
572
+ if (prepend) {
573
+ opts.currSlide++;
574
+ opts.nextSlide++;
575
+ }
576
+
577
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
578
+ clearTypeFix($s);
579
+
580
+ if (opts.fit && opts.width)
581
+ $s.width(opts.width);
582
+ if (opts.fit && opts.height && opts.height != 'auto')
583
+ $s.height(opts.height);
584
+ s.smoothH = (opts.fit && opts.height) ? opts.height : $s.height();
585
+ s.smoothW = (opts.fit && opts.width) ? opts.width : $s.width();
586
+
587
+ $s.css(opts.cssBefore);
588
+
589
+ if (opts.pager || opts.pagerAnchorBuilder)
590
+ $.fn.smooth.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
591
+
592
+ if ($.isFunction(opts.onAddSlide))
593
+ opts.onAddSlide($s);
594
+ else
595
+ $s.hide(); // default behavior
596
+ };
597
+ }
598
+
599
+ // reset internal state; we do this on every pass in order to support multiple effects
600
+ $.fn.smooth.resetState = function(opts, fx) {
601
+ fx = fx || opts.fx;
602
+ opts.before = []; opts.after = [];
603
+ opts.cssBefore = $.extend({}, opts.original.cssBefore);
604
+ opts.cssAfter = $.extend({}, opts.original.cssAfter);
605
+ opts.animIn = $.extend({}, opts.original.animIn);
606
+ opts.animOut = $.extend({}, opts.original.animOut);
607
+ opts.fxFn = null;
608
+ $.each(opts.original.before, function() { opts.before.push(this); });
609
+ $.each(opts.original.after, function() { opts.after.push(this); });
610
+
611
+ // re-init
612
+ var init = $.fn.smooth.transitions[fx];
613
+ if ($.isFunction(init))
614
+ init(opts.$cont, $(opts.elements), opts);
615
+ };
616
+
617
+ // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
618
+ function go(els, opts, manual, fwd) {
619
+ var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
620
+
621
+ // opts.busy is true if we're in the middle of an animation
622
+ if (manual && opts.busy && opts.manualTrump) {
623
+ // let manual transitions requests trump active ones
624
+ debug('manualTrump in go(), stopping active transition');
625
+ $(els).stop(true,true);
626
+ opts.busy = 0;
627
+ clearTimeout(p.smoothTimeout);
628
+ }
629
+
630
+ // don't begin another timeout-based transition if there is one active
631
+ if (opts.busy) {
632
+ debug('transition active, ignoring new tx request');
633
+ return;
634
+ }
635
+
636
+
637
+ // stop cycling if we have an outstanding stop request
638
+ if (p.smoothStop != opts.stopCount || p.smoothTimeout === 0 && !manual)
639
+ return;
640
+
641
+ // check to see if we should stop cycling based on autostop options
642
+ if (!manual && !p.smoothPause && !opts.bounce &&
643
+ ((opts.autostop && (--opts.countdown <= 0)) ||
644
+ (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
645
+ if (opts.end)
646
+ opts.end(opts);
647
+ return;
648
+ }
649
+
650
+ // if slideshow is paused, only transition on a manual trigger
651
+ var changed = false;
652
+ if ((manual || !p.smoothPause) && (opts.nextSlide != opts.currSlide)) {
653
+ changed = true;
654
+ var fx = opts.fx;
655
+ // keep trying to get the slide size if we don't have it yet
656
+ curr.smoothH = curr.smoothH || $(curr).height();
657
+ curr.smoothW = curr.smoothW || $(curr).width();
658
+ next.smoothH = next.smoothH || $(next).height();
659
+ next.smoothW = next.smoothW || $(next).width();
660
+
661
+ // support multiple transition types
662
+ if (opts.multiFx) {
663
+ if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length))
664
+ opts.lastFx = 0;
665
+ else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0))
666
+ opts.lastFx = opts.fxs.length - 1;
667
+ fx = opts.fxs[opts.lastFx];
668
+ }
669
+
670
+ // one-time fx overrides apply to: $('div').smooth(3,'zoom');
671
+ if (opts.oneTimeFx) {
672
+ fx = opts.oneTimeFx;
673
+ opts.oneTimeFx = null;
674
+ }
675
+
676
+ $.fn.smooth.resetState(opts, fx);
677
+
678
+ // run the before callbacks
679
+ if (opts.before.length)
680
+ $.each(opts.before, function(i,o) {
681
+ if (p.smoothStop != opts.stopCount) return;
682
+ o.apply(next, [curr, next, opts, fwd]);
683
+ });
684
+
685
+ // stage the after callacks
686
+ var after = function() {
687
+ opts.busy = 0;
688
+ $.each(opts.after, function(i,o) {
689
+ if (p.smoothStop != opts.stopCount) return;
690
+ o.apply(next, [curr, next, opts, fwd]);
691
+ });
692
+ if (!p.smoothStop) {
693
+ // queue next transition
694
+ queueNext();
695
+ }
696
+ };
697
+
698
+ debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
699
+
700
+ // get ready to perform the transition
701
+ opts.busy = 1;
702
+ if (opts.fxFn) // fx function provided?
703
+ opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
704
+ else if ($.isFunction($.fn.smooth[opts.fx])) // fx plugin ?
705
+ $.fn.smooth[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
706
+ else
707
+ $.fn.smooth.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
708
+ }
709
+ else {
710
+ queueNext();
711
+ }
712
+
713
+ if (changed || opts.nextSlide == opts.currSlide) {
714
+ // calculate the next slide
715
+ var roll;
716
+ opts.lastSlide = opts.currSlide;
717
+ if (opts.random) {
718
+ opts.currSlide = opts.nextSlide;
719
+ if (++opts.randomIndex == els.length) {
720
+ opts.randomIndex = 0;
721
+ opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
722
+ }
723
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
724
+ if (opts.nextSlide == opts.currSlide)
725
+ opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
726
+ }
727
+ else if (opts.backwards) {
728
+ roll = (opts.nextSlide - 1) < 0;
729
+ if (roll && opts.bounce) {
730
+ opts.backwards = !opts.backwards;
731
+ opts.nextSlide = 1;
732
+ opts.currSlide = 0;
733
+ }
734
+ else {
735
+ opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
736
+ opts.currSlide = roll ? 0 : opts.nextSlide+1;
737
+ }
738
+ }
739
+ else { // sequence
740
+ roll = (opts.nextSlide + 1) == els.length;
741
+ if (roll && opts.bounce) {
742
+ opts.backwards = !opts.backwards;
743
+ opts.nextSlide = els.length-2;
744
+ opts.currSlide = els.length-1;
745
+ }
746
+ else {
747
+ opts.nextSlide = roll ? 0 : opts.nextSlide+1;
748
+ opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
749
+ }
750
+ }
751
+ }
752
+ if (changed && opts.pager)
753
+ opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
754
+
755
+ function queueNext() {
756
+ // stage the next transition
757
+ var ms = 0, timeout = opts.timeout;
758
+ if (opts.timeout && !opts.continuous) {
759
+ ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
760
+ if (opts.fx == 'shuffle')
761
+ ms -= opts.speedOut;
762
+ }
763
+ else if (opts.continuous && p.smoothPause) // continuous shows work off an after callback, not this timer logic
764
+ ms = 10;
765
+ if (ms > 0)
766
+ p.smoothTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms);
767
+ }
768
+ }
769
+
770
+ // invoked after transition
771
+ $.fn.smooth.updateActivePagerLink = function(pager, currSlide, clsName) {
772
+ $(pager).each(function() {
773
+ $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
774
+ });
775
+ };
776
+
777
+ // calculate timeout value for current transition
778
+ function getTimeout(curr, next, opts, fwd) {
779
+ if (opts.timeoutFn) {
780
+ // call user provided calc fn
781
+ var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
782
+ while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout
783
+ t += opts.speed;
784
+ debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
785
+ if (t !== false)
786
+ return t;
787
+ }
788
+ return opts.timeout;
789
+ }
790
+
791
+ // expose next/prev function, caller must pass in state
792
+ $.fn.smooth.next = function(opts) { advance(opts,1); };
793
+ $.fn.smooth.prev = function(opts) { advance(opts,0);};
794
+
795
+ // advance slide forward or back
796
+ function advance(opts, moveForward) {
797
+ var val = moveForward ? 1 : -1;
798
+ var els = opts.elements;
799
+ var p = opts.$cont[0], timeout = p.smoothTimeout;
800
+ if (timeout) {
801
+ clearTimeout(timeout);
802
+ p.smoothTimeout = 0;
803
+ }
804
+ if (opts.random && val < 0) {
805
+ // move back to the previously display slide
806
+ opts.randomIndex--;
807
+ if (--opts.randomIndex == -2)
808
+ opts.randomIndex = els.length-2;
809
+ else if (opts.randomIndex == -1)
810
+ opts.randomIndex = els.length-1;
811
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
812
+ }
813
+ else if (opts.random) {
814
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
815
+ }
816
+ else {
817
+ opts.nextSlide = opts.currSlide + val;
818
+ if (opts.nextSlide < 0) {
819
+ if (opts.nowrap) return false;
820
+ opts.nextSlide = els.length - 1;
821
+ }
822
+ else if (opts.nextSlide >= els.length) {
823
+ if (opts.nowrap) return false;
824
+ opts.nextSlide = 0;
825
+ }
826
+ }
827
+
828
+ var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
829
+ if ($.isFunction(cb))
830
+ cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
831
+ go(els, opts, 1, moveForward);
832
+ return false;
833
+ }
834
+
835
+ function buildPager(els, opts) {
836
+ var $p = $(opts.pager);
837
+ $.each(els, function(i,o) {
838
+ $.fn.smooth.createPagerAnchor(i,o,$p,els,opts);
839
+ });
840
+ opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
841
+ }
842
+
843
+ $.fn.smooth.createPagerAnchor = function(i, el, $p, els, opts) {
844
+ var a;
845
+ if ($.isFunction(opts.pagerAnchorBuilder)) {
846
+ a = opts.pagerAnchorBuilder(i,el);
847
+ debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
848
+ }
849
+ else
850
+ a = '<a href="#">'+(i+1)+'</a>';
851
+
852
+ if (!a)
853
+ return;
854
+ var $a = $(a);
855
+ // don't reparent if anchor is in the dom
856
+ if ($a.parents('body').length === 0) {
857
+ var arr = [];
858
+ if ($p.length > 1) {
859
+ $p.each(function() {
860
+ var $clone = $a.clone(true);
861
+ $(this).append($clone);
862
+ arr.push($clone[0]);
863
+ });
864
+ $a = $(arr);
865
+ }
866
+ else {
867
+ $a.appendTo($p);
868
+ }
869
+ }
870
+
871
+ opts.pagerAnchors = opts.pagerAnchors || [];
872
+ opts.pagerAnchors.push($a);
873
+
874
+ var pagerFn = function(e) {
875
+ e.preventDefault();
876
+ opts.nextSlide = i;
877
+ var p = opts.$cont[0], timeout = p.smoothTimeout;
878
+ if (timeout) {
879
+ clearTimeout(timeout);
880
+ p.smoothTimeout = 0;
881
+ }
882
+ var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
883
+ if ($.isFunction(cb))
884
+ cb(opts.nextSlide, els[opts.nextSlide]);
885
+ go(els,opts,1,opts.currSlide < i); // trigger the trans
886
+ // return false; // <== allow bubble
887
+ };
888
+
889
+ if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {
890
+ $a.hover(pagerFn, function(){/* no-op */} );
891
+ }
892
+ else {
893
+ $a.bind(opts.pagerEvent, pagerFn);
894
+ }
895
+
896
+ if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
897
+ $a.bind('click.smooth', function(){return false;}); // suppress click
898
+
899
+ var cont = opts.$cont[0];
900
+ var pauseFlag = false; // https://github.com/malsup/smooth/issues/44
901
+ if (opts.pauseOnPagerHover) {
902
+ $a.hover(
903
+ function() {
904
+ pauseFlag = true;
905
+ cont.smoothPause++;
906
+ triggerPause(cont,true,true);
907
+ }, function() {
908
+ if (pauseFlag)
909
+ cont.smoothPause--;
910
+ triggerPause(cont,true,true);
911
+ }
912
+ );
913
+ }
914
+ };
915
+
916
+ // helper fn to calculate the number of slides between the current and the next
917
+ $.fn.smooth.hopsFromLast = function(opts, fwd) {
918
+ var hops, l = opts.lastSlide, c = opts.currSlide;
919
+ if (fwd)
920
+ hops = c > l ? c - l : opts.slideCount - l;
921
+ else
922
+ hops = c < l ? l - c : l + opts.slideCount - c;
923
+ return hops;
924
+ };
925
+
926
+ // fix clearType problems in ie6 by setting an explicit bg color
927
+ // (otherwise text slides look horrible during a fade transition)
928
+ function clearTypeFix($slides) {
929
+ debug('applying clearType background-color hack');
930
+ function hex(s) {
931
+ s = parseInt(s,10).toString(16);
932
+ return s.length < 2 ? '0'+s : s;
933
+ }
934
+ function getBg(e) {
935
+ for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
936
+ var v = $.css(e,'background-color');
937
+ if (v && v.indexOf('rgb') >= 0 ) {
938
+ var rgb = v.match(/\d+/g);
939
+ return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
940
+ }
941
+ if (v && v != 'transparent')
942
+ return v;
943
+ }
944
+ return '#ffffff';
945
+ }
946
+ $slides.each(function() { $(this).css('background-color', getBg(this)); });
947
+ }
948
+
949
+ // reset common props before the next transition
950
+ $.fn.smooth.commonReset = function(curr,next,opts,w,h,rev) {
951
+ $(opts.elements).not(curr).hide();
952
+ if (typeof opts.cssBefore.opacity == 'undefined')
953
+ opts.cssBefore.opacity = 1;
954
+ opts.cssBefore.display = 'block';
955
+ if (opts.slideResize && w !== false && next.smoothW > 0)
956
+ opts.cssBefore.width = next.smoothW;
957
+ if (opts.slideResize && h !== false && next.smoothH > 0)
958
+ opts.cssBefore.height = next.smoothH;
959
+ opts.cssAfter = opts.cssAfter || {};
960
+ opts.cssAfter.display = 'none';
961
+ $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
962
+ $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
963
+ };
964
+
965
+ // the actual fn for effecting a transition
966
+ $.fn.smooth.custom = function(curr, next, opts, cb, fwd, speedOverride) {
967
+ var $l = $(curr), $n = $(next);
968
+ var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animInDelay = opts.animInDelay, animOutDelay = opts.animOutDelay;
969
+ $n.css(opts.cssBefore);
970
+ if (speedOverride) {
971
+ if (typeof speedOverride == 'number')
972
+ speedIn = speedOut = speedOverride;
973
+ else
974
+ speedIn = speedOut = 1;
975
+ easeIn = easeOut = null;
976
+ }
977
+ var fn = function() {
978
+ $n.delay(animInDelay).animate(opts.animIn, speedIn, easeIn, function() {
979
+ cb();
980
+ });
981
+ };
982
+ $l.delay(animOutDelay).animate(opts.animOut, speedOut, easeOut, function() {
983
+ $l.css(opts.cssAfter);
984
+ if (!opts.sync)
985
+ fn();
986
+ });
987
+ if (opts.sync) fn();
988
+ };
989
+
990
+ // transition definitions - only fade is defined here, transition pack defines the rest
991
+ $.fn.smooth.transitions = {
992
+ fade: function($cont, $slides, opts) {
993
+ $slides.not(':eq('+opts.currSlide+')').css('opacity',0);
994
+ opts.before.push(function(curr,next,opts) {
995
+ $.fn.smooth.commonReset(curr,next,opts);
996
+ opts.cssBefore.opacity = 0;
997
+ });
998
+ opts.animIn = { opacity: 1 };
999
+ opts.animOut = { opacity: 0 };
1000
+ opts.cssBefore = { top: 0, left: 0 };
1001
+ }
1002
+ };
1003
+
1004
+ $.fn.smooth.ver = function() { return ver; };
1005
+
1006
+ // override these globally if you like (they are all optional)
1007
+ $.fn.smooth.defaults = {
1008
+ activePagerClass: 'activeSlide', // class name used for the active pager link
1009
+ after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
1010
+ allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
1011
+ animIn: null, // properties that define how the slide animates in
1012
+ animInDelay: 0, // allows delay before next slide transitions in
1013
+ animOut: null, // properties that define how the slide animates out
1014
+ animOutDelay: 0, // allows delay before current slide transitions out
1015
+ aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option)
1016
+ autostop: 0, // true to end slideshow after X transitions (where X == slide count)
1017
+ autostopCount: 0, // number of transitions (optionally used with autostop to define X)
1018
+ backwards: false, // true to start slideshow at last slide and move backwards through the stack
1019
+ before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
1020
+ center: null, // set to true to have smooth add top/left margin to each slide (use with width and height options)
1021
+ cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE)
1022
+ cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
1023
+ containerResize: 1, // resize container to fit largest slide
1024
+ containerResizeHeight: 0, // resize containers height to fit the largest slide but leave the width dynamic
1025
+ continuous: 0, // true to start next transition immediately after current one completes
1026
+ cssAfter: null, // properties that defined the state of the slide after transitioning out
1027
+ cssBefore: null, // properties that define the initial state of the slide before transitioning in
1028
+ delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
1029
+ easeIn: null, // easing for "in" transition
1030
+ easeOut: null, // easing for "out" transition
1031
+ easing: null, // easing method for both in and out transitions
1032
+ end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
1033
+ fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
1034
+ fit: 0, // force slides to fit container
1035
+ fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
1036
+ fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
1037
+ height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well)
1038
+ manualTrump: true, // causes manual transition to stop an active transition instead of being ignored
1039
+ metaAttr: 'smooth', // data- attribute that holds the option data for the slideshow
1040
+ next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide
1041
+ nowrap: 0, // true to prevent slideshow from wrapping
1042
+ onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
1043
+ onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
1044
+ pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container
1045
+ pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement)
1046
+ pagerEvent: 'click.smooth', // name of event which drives the pager navigation
1047
+ pause: 0, // true to enable "pause on hover"
1048
+ pauseOnPagerHover: 0, // true to pause when hovering over pager link
1049
+ prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide
1050
+ prevNextEvent: 'click.smooth',// event which drives the manual transition to the previous or next slide
1051
+ random: 0, // true for random, false for sequence (not applicable to shuffle fx)
1052
+ randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random
1053
+ requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
1054
+ requeueTimeout: 250, // ms delay for requeue
1055
+ rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle)
1056
+ shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
1057
+ skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
1058
+ slideExpr: null, // expression for selecting slides (if something other than all children is required)
1059
+ slideResize: 1, // force slide width/height to fixed size before every transition
1060
+ speed: 1000, // speed of the transition (any valid fx speed value)
1061
+ speedIn: null, // speed of the 'in' transition
1062
+ speedOut: null, // speed of the 'out' transition
1063
+ startingSlide: undefined,// zero-based index of the first slide to be displayed
1064
+ sync: 1, // true if in/out transitions should occur simultaneously
1065
+ timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
1066
+ timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
1067
+ updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style)
1068
+ width: null // container width (if the 'fit' option is true, the slides will be set to this width as well)
1069
+ };
1070
+
1071
+ })(jQuery);
1072
+
1073
+
1074
+ /*!
1075
+ * jQuery Cycle Plugin Transition Definitions
1076
+ * This script is a plugin for the jQuery Cycle Plugin
1077
+ * Examples and documentation at: http://malsup.com/jquery/smooth/
1078
+ * Copyright (c) 2007-2010 M. Alsup
1079
+ * Version: 2.73
1080
+ * Dual licensed under the MIT and GPL licenses:
1081
+ * http://www.opensource.org/licenses/mit-license.php
1082
+ * http://www.gnu.org/licenses/gpl.html
1083
+ */
1084
+ (function($) {
1085
+ "use strict";
1086
+
1087
+ //
1088
+ // These functions define slide initialization and properties for the named
1089
+ // transitions. To save file size feel free to remove any of these that you
1090
+ // don't need.
1091
+ //
1092
+ $.fn.smooth.transitions.none = function($cont, $slides, opts) {
1093
+ opts.fxFn = function(curr,next,opts,after){
1094
+ $(next).show();
1095
+ $(curr).hide();
1096
+ after();
1097
+ };
1098
+ };
1099
+
1100
+ // not a cross-fade, fadeout only fades out the top slide
1101
+ $.fn.smooth.transitions.fadeout = function($cont, $slides, opts) {
1102
+ $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
1103
+ opts.before.push(function(curr,next,opts,w,h,rev) {
1104
+ $(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0));
1105
+ $(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1));
1106
+ });
1107
+ opts.animIn.opacity = 1;
1108
+ opts.animOut.opacity = 0;
1109
+ opts.cssBefore.opacity = 1;
1110
+ opts.cssBefore.display = 'block';
1111
+ opts.cssAfter.zIndex = 0;
1112
+ };
1113
+
1114
+ // scrollUp/Down/Left/Right
1115
+ $.fn.smooth.transitions.scrollUp = function($cont, $slides, opts) {
1116
+ $cont.css('overflow','hidden');
1117
+ opts.before.push($.fn.smooth.commonReset);
1118
+ var h = $cont.height();
1119
+ opts.cssBefore.top = h;
1120
+ opts.cssBefore.left = 0;
1121
+ opts.cssFirst.top = 0;
1122
+ opts.animIn.top = 0;
1123
+ opts.animOut.top = -h;
1124
+ };
1125
+ $.fn.smooth.transitions.scrollDown = function($cont, $slides, opts) {
1126
+ $cont.css('overflow','hidden');
1127
+ opts.before.push($.fn.smooth.commonReset);
1128
+ var h = $cont.height();
1129
+ opts.cssFirst.top = 0;
1130
+ opts.cssBefore.top = -h;
1131
+ opts.cssBefore.left = 0;
1132
+ opts.animIn.top = 0;
1133
+ opts.animOut.top = h;
1134
+ };
1135
+ $.fn.smooth.transitions.scrollLeft = function($cont, $slides, opts) {
1136
+ $cont.css('overflow','hidden');
1137
+ opts.before.push($.fn.smooth.commonReset);
1138
+ var w = $cont.width();
1139
+ opts.cssFirst.left = 0;
1140
+ opts.cssBefore.left = w;
1141
+ opts.cssBefore.top = 0;
1142
+ opts.animIn.left = 0;
1143
+ opts.animOut.left = 0-w;
1144
+ };
1145
+ $.fn.smooth.transitions.scrollRight = function($cont, $slides, opts) {
1146
+ $cont.css('overflow','hidden');
1147
+ opts.before.push($.fn.smooth.commonReset);
1148
+ var w = $cont.width();
1149
+ opts.cssFirst.left = 0;
1150
+ opts.cssBefore.left = -w;
1151
+ opts.cssBefore.top = 0;
1152
+ opts.animIn.left = 0;
1153
+ opts.animOut.left = w;
1154
+ };
1155
+ $.fn.smooth.transitions.scrollHorz = function($cont, $slides, opts) {
1156
+ $cont.css('overflow','hidden').width();
1157
+ opts.before.push(function(curr, next, opts, fwd) {
1158
+ if (opts.rev)
1159
+ fwd = !fwd;
1160
+ $.fn.smooth.commonReset(curr,next,opts);
1161
+ opts.cssBefore.left = fwd ? (next.smoothW-1) : (1-next.smoothW);
1162
+ opts.animOut.left = fwd ? -curr.smoothW : curr.smoothW;
1163
+ });
1164
+ opts.cssFirst.left = 0;
1165
+ opts.cssBefore.top = 0;
1166
+ opts.animIn.left = 0;
1167
+ opts.animOut.top = 0;
1168
+ };
1169
+ $.fn.smooth.transitions.scrollVert = function($cont, $slides, opts) {
1170
+ $cont.css('overflow','hidden');
1171
+ opts.before.push(function(curr, next, opts, fwd) {
1172
+ if (opts.rev)
1173
+ fwd = !fwd;
1174
+ $.fn.smooth.commonReset(curr,next,opts);
1175
+ opts.cssBefore.top = fwd ? (1-next.smoothH) : (next.smoothH-1);
1176
+ opts.animOut.top = fwd ? curr.smoothH : -curr.smoothH;
1177
+ });
1178
+ opts.cssFirst.top = 0;
1179
+ opts.cssBefore.left = 0;
1180
+ opts.animIn.top = 0;
1181
+ opts.animOut.left = 0;
1182
+ };
1183
+
1184
+ // slideX/slideY
1185
+ $.fn.smooth.transitions.slideX = function($cont, $slides, opts) {
1186
+ opts.before.push(function(curr, next, opts) {
1187
+ $(opts.elements).not(curr).hide();
1188
+ $.fn.smooth.commonReset(curr,next,opts,false,true);
1189
+ opts.animIn.width = next.smoothW;
1190
+ });
1191
+ opts.cssBefore.left = 0;
1192
+ opts.cssBefore.top = 0;
1193
+ opts.cssBefore.width = 0;
1194
+ opts.animIn.width = 'show';
1195
+ opts.animOut.width = 0;
1196
+ };
1197
+ $.fn.smooth.transitions.slideY = function($cont, $slides, opts) {
1198
+ opts.before.push(function(curr, next, opts) {
1199
+ $(opts.elements).not(curr).hide();
1200
+ $.fn.smooth.commonReset(curr,next,opts,true,false);
1201
+ opts.animIn.height = next.smoothH;
1202
+ });
1203
+ opts.cssBefore.left = 0;
1204
+ opts.cssBefore.top = 0;
1205
+ opts.cssBefore.height = 0;
1206
+ opts.animIn.height = 'show';
1207
+ opts.animOut.height = 0;
1208
+ };
1209
+
1210
+ // shuffle
1211
+ $.fn.smooth.transitions.shuffle = function($cont, $slides, opts) {
1212
+ var i, w = $cont.css('overflow', 'visible').width();
1213
+ $slides.css({left: 0, top: 0});
1214
+ opts.before.push(function(curr,next,opts) {
1215
+ $.fn.smooth.commonReset(curr,next,opts,true,true,true);
1216
+ });
1217
+ // only adjust speed once!
1218
+ if (!opts.speedAdjusted) {
1219
+ opts.speed = opts.speed / 2; // shuffle has 2 transitions
1220
+ opts.speedAdjusted = true;
1221
+ }
1222
+ opts.random = 0;
1223
+ opts.shuffle = opts.shuffle || {left:-w, top:15};
1224
+ opts.els = [];
1225
+ for (i=0; i < $slides.length; i++)
1226
+ opts.els.push($slides[i]);
1227
+
1228
+ for (i=0; i < opts.currSlide; i++)
1229
+ opts.els.push(opts.els.shift());
1230
+
1231
+ // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1232
+ opts.fxFn = function(curr, next, opts, cb, fwd) {
1233
+ if (opts.rev)
1234
+ fwd = !fwd;
1235
+ var $el = fwd ? $(curr) : $(next);
1236
+ $(next).css(opts.cssBefore);
1237
+ var count = opts.slideCount;
1238
+ $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1239
+ var hops = $.fn.smooth.hopsFromLast(opts, fwd);
1240
+ for (var k=0; k < hops; k++) {
1241
+ if (fwd)
1242
+ opts.els.push(opts.els.shift());
1243
+ else
1244
+ opts.els.unshift(opts.els.pop());
1245
+ }
1246
+ if (fwd) {
1247
+ for (var i=0, len=opts.els.length; i < len; i++)
1248
+ $(opts.els[i]).css('z-index', len-i+count);
1249
+ }
1250
+ else {
1251
+ var z = $(curr).css('z-index');
1252
+ $el.css('z-index', parseInt(z,10)+1+count);
1253
+ }
1254
+ $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1255
+ $(fwd ? this : curr).hide();
1256
+ if (cb) cb();
1257
+ });
1258
+ });
1259
+ };
1260
+ $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1261
+ };
1262
+
1263
+ // turnUp/Down/Left/Right
1264
+ $.fn.smooth.transitions.turnUp = function($cont, $slides, opts) {
1265
+ opts.before.push(function(curr, next, opts) {
1266
+ $.fn.smooth.commonReset(curr,next,opts,true,false);
1267
+ opts.cssBefore.top = next.smoothH;
1268
+ opts.animIn.height = next.smoothH;
1269
+ opts.animOut.width = next.smoothW;
1270
+ });
1271
+ opts.cssFirst.top = 0;
1272
+ opts.cssBefore.left = 0;
1273
+ opts.cssBefore.height = 0;
1274
+ opts.animIn.top = 0;
1275
+ opts.animOut.height = 0;
1276
+ };
1277
+ $.fn.smooth.transitions.turnDown = function($cont, $slides, opts) {
1278
+ opts.before.push(function(curr, next, opts) {
1279
+ $.fn.smooth.commonReset(curr,next,opts,true,false);
1280
+ opts.animIn.height = next.smoothH;
1281
+ opts.animOut.top = curr.smoothH;
1282
+ });
1283
+ opts.cssFirst.top = 0;
1284
+ opts.cssBefore.left = 0;
1285
+ opts.cssBefore.top = 0;
1286
+ opts.cssBefore.height = 0;
1287
+ opts.animOut.height = 0;
1288
+ };
1289
+ $.fn.smooth.transitions.turnLeft = function($cont, $slides, opts) {
1290
+ opts.before.push(function(curr, next, opts) {
1291
+ $.fn.smooth.commonReset(curr,next,opts,false,true);
1292
+ opts.cssBefore.left = next.smoothW;
1293
+ opts.animIn.width = next.smoothW;
1294
+ });
1295
+ opts.cssBefore.top = 0;
1296
+ opts.cssBefore.width = 0;
1297
+ opts.animIn.left = 0;
1298
+ opts.animOut.width = 0;
1299
+ };
1300
+ $.fn.smooth.transitions.turnRight = function($cont, $slides, opts) {
1301
+ opts.before.push(function(curr, next, opts) {
1302
+ $.fn.smooth.commonReset(curr,next,opts,false,true);
1303
+ opts.animIn.width = next.smoothW;
1304
+ opts.animOut.left = curr.smoothW;
1305
+ });
1306
+ $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
1307
+ opts.animIn.left = 0;
1308
+ opts.animOut.width = 0;
1309
+ };
1310
+
1311
+ // zoom
1312
+ $.fn.smooth.transitions.zoom = function($cont, $slides, opts) {
1313
+ opts.before.push(function(curr, next, opts) {
1314
+ $.fn.smooth.commonReset(curr,next,opts,false,false,true);
1315
+ opts.cssBefore.top = next.smoothH/2;
1316
+ opts.cssBefore.left = next.smoothW/2;
1317
+ $.extend(opts.animIn, { top: 0, left: 0, width: next.smoothW, height: next.smoothH });
1318
+ $.extend(opts.animOut, { width: 0, height: 0, top: curr.smoothH/2, left: curr.smoothW/2 });
1319
+ });
1320
+ opts.cssFirst.top = 0;
1321
+ opts.cssFirst.left = 0;
1322
+ opts.cssBefore.width = 0;
1323
+ opts.cssBefore.height = 0;
1324
+ };
1325
+
1326
+ // fadeZoom
1327
+ $.fn.smooth.transitions.fadeZoom = function($cont, $slides, opts) {
1328
+ opts.before.push(function(curr, next, opts) {
1329
+ $.fn.smooth.commonReset(curr,next,opts,false,false);
1330
+ opts.cssBefore.left = next.smoothW/2;
1331
+ opts.cssBefore.top = next.smoothH/2;
1332
+ $.extend(opts.animIn, { top: 0, left: 0, width: next.smoothW, height: next.smoothH });
1333
+ });
1334
+ opts.cssBefore.width = 0;
1335
+ opts.cssBefore.height = 0;
1336
+ opts.animOut.opacity = 0;
1337
+ };
1338
+
1339
+ // blindX
1340
+ $.fn.smooth.transitions.blindX = function($cont, $slides, opts) {
1341
+ var w = $cont.css('overflow','hidden').width();
1342
+ opts.before.push(function(curr, next, opts) {
1343
+ $.fn.smooth.commonReset(curr,next,opts);
1344
+ opts.animIn.width = next.smoothW;
1345
+ opts.animOut.left = curr.smoothW;
1346
+ });
1347
+ opts.cssBefore.left = w;
1348
+ opts.cssBefore.top = 0;
1349
+ opts.animIn.left = 0;
1350
+ opts.animOut.left = w;
1351
+ };
1352
+ // blindY
1353
+ $.fn.smooth.transitions.blindY = function($cont, $slides, opts) {
1354
+ var h = $cont.css('overflow','hidden').height();
1355
+ opts.before.push(function(curr, next, opts) {
1356
+ $.fn.smooth.commonReset(curr,next,opts);
1357
+ opts.animIn.height = next.smoothH;
1358
+ opts.animOut.top = curr.smoothH;
1359
+ });
1360
+ opts.cssBefore.top = h;
1361
+ opts.cssBefore.left = 0;
1362
+ opts.animIn.top = 0;
1363
+ opts.animOut.top = h;
1364
+ };
1365
+ // blindZ
1366
+ $.fn.smooth.transitions.blindZ = function($cont, $slides, opts) {
1367
+ var h = $cont.css('overflow','hidden').height();
1368
+ var w = $cont.width();
1369
+ opts.before.push(function(curr, next, opts) {
1370
+ $.fn.smooth.commonReset(curr,next,opts);
1371
+ opts.animIn.height = next.smoothH;
1372
+ opts.animOut.top = curr.smoothH;
1373
+ });
1374
+ opts.cssBefore.top = h;
1375
+ opts.cssBefore.left = w;
1376
+ opts.animIn.top = 0;
1377
+ opts.animIn.left = 0;
1378
+ opts.animOut.top = h;
1379
+ opts.animOut.left = w;
1380
+ };
1381
+
1382
+ // growX - grow horizontally from centered 0 width
1383
+ $.fn.smooth.transitions.growX = function($cont, $slides, opts) {
1384
+ opts.before.push(function(curr, next, opts) {
1385
+ $.fn.smooth.commonReset(curr,next,opts,false,true);
1386
+ opts.cssBefore.left = this.smoothW/2;
1387
+ opts.animIn.left = 0;
1388
+ opts.animIn.width = this.smoothW;
1389
+ opts.animOut.left = 0;
1390
+ });
1391
+ opts.cssBefore.top = 0;
1392
+ opts.cssBefore.width = 0;
1393
+ };
1394
+ // growY - grow vertically from centered 0 height
1395
+ $.fn.smooth.transitions.growY = function($cont, $slides, opts) {
1396
+ opts.before.push(function(curr, next, opts) {
1397
+ $.fn.smooth.commonReset(curr,next,opts,true,false);
1398
+ opts.cssBefore.top = this.smoothH/2;
1399
+ opts.animIn.top = 0;
1400
+ opts.animIn.height = this.smoothH;
1401
+ opts.animOut.top = 0;
1402
+ });
1403
+ opts.cssBefore.height = 0;
1404
+ opts.cssBefore.left = 0;
1405
+ };
1406
+
1407
+ // curtainX - squeeze in both edges horizontally
1408
+ $.fn.smooth.transitions.curtainX = function($cont, $slides, opts) {
1409
+ opts.before.push(function(curr, next, opts) {
1410
+ $.fn.smooth.commonReset(curr,next,opts,false,true,true);
1411
+ opts.cssBefore.left = next.smoothW/2;
1412
+ opts.animIn.left = 0;
1413
+ opts.animIn.width = this.smoothW;
1414
+ opts.animOut.left = curr.smoothW/2;
1415
+ opts.animOut.width = 0;
1416
+ });
1417
+ opts.cssBefore.top = 0;
1418
+ opts.cssBefore.width = 0;
1419
+ };
1420
+ // curtainY - squeeze in both edges vertically
1421
+ $.fn.smooth.transitions.curtainY = function($cont, $slides, opts) {
1422
+ opts.before.push(function(curr, next, opts) {
1423
+ $.fn.smooth.commonReset(curr,next,opts,true,false,true);
1424
+ opts.cssBefore.top = next.smoothH/2;
1425
+ opts.animIn.top = 0;
1426
+ opts.animIn.height = next.smoothH;
1427
+ opts.animOut.top = curr.smoothH/2;
1428
+ opts.animOut.height = 0;
1429
+ });
1430
+ opts.cssBefore.height = 0;
1431
+ opts.cssBefore.left = 0;
1432
+ };
1433
+
1434
+ // cover - curr slide covered by next slide
1435
+ $.fn.smooth.transitions.cover = function($cont, $slides, opts) {
1436
+ var d = opts.direction || 'left';
1437
+ var w = $cont.css('overflow','hidden').width();
1438
+ var h = $cont.height();
1439
+ opts.before.push(function(curr, next, opts) {
1440
+ $.fn.smooth.commonReset(curr,next,opts);
1441
+ opts.cssAfter.display = '';
1442
+ if (d == 'right')
1443
+ opts.cssBefore.left = -w;
1444
+ else if (d == 'up')
1445
+ opts.cssBefore.top = h;
1446
+ else if (d == 'down')
1447
+ opts.cssBefore.top = -h;
1448
+ else
1449
+ opts.cssBefore.left = w;
1450
+ });
1451
+ opts.animIn.left = 0;
1452
+ opts.animIn.top = 0;
1453
+ opts.cssBefore.top = 0;
1454
+ opts.cssBefore.left = 0;
1455
+ };
1456
+
1457
+ // uncover - curr slide moves off next slide
1458
+ $.fn.smooth.transitions.uncover = function($cont, $slides, opts) {
1459
+ var d = opts.direction || 'left';
1460
+ var w = $cont.css('overflow','hidden').width();
1461
+ var h = $cont.height();
1462
+ opts.before.push(function(curr, next, opts) {
1463
+ $.fn.smooth.commonReset(curr,next,opts,true,true,true);
1464
+ if (d == 'right')
1465
+ opts.animOut.left = w;
1466
+ else if (d == 'up')
1467
+ opts.animOut.top = -h;
1468
+ else if (d == 'down')
1469
+ opts.animOut.top = h;
1470
+ else
1471
+ opts.animOut.left = -w;
1472
+ });
1473
+ opts.animIn.left = 0;
1474
+ opts.animIn.top = 0;
1475
+ opts.cssBefore.top = 0;
1476
+ opts.cssBefore.left = 0;
1477
+ };
1478
+
1479
+ // toss - move top slide and fade away
1480
+ $.fn.smooth.transitions.toss = function($cont, $slides, opts) {
1481
+ var w = $cont.css('overflow','visible').width();
1482
+ var h = $cont.height();
1483
+ opts.before.push(function(curr, next, opts) {
1484
+ $.fn.smooth.commonReset(curr,next,opts,true,true,true);
1485
+ // provide default toss settings if animOut not provided
1486
+ if (!opts.animOut.left && !opts.animOut.top)
1487
+ $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
1488
+ else
1489
+ opts.animOut.opacity = 0;
1490
+ });
1491
+ opts.cssBefore.left = 0;
1492
+ opts.cssBefore.top = 0;
1493
+ opts.animIn.left = 0;
1494
+ };
1495
+
1496
+ // wipe - clip animation
1497
+ $.fn.smooth.transitions.wipe = function($cont, $slides, opts) {
1498
+ var w = $cont.css('overflow','hidden').width();
1499
+ var h = $cont.height();
1500
+ opts.cssBefore = opts.cssBefore || {};
1501
+ var clip;
1502
+ if (opts.clip) {
1503
+ if (/l2r/.test(opts.clip))
1504
+ clip = 'rect(0px 0px '+h+'px 0px)';
1505
+ else if (/r2l/.test(opts.clip))
1506
+ clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
1507
+ else if (/t2b/.test(opts.clip))
1508
+ clip = 'rect(0px '+w+'px 0px 0px)';
1509
+ else if (/b2t/.test(opts.clip))
1510
+ clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
1511
+ else if (/zoom/.test(opts.clip)) {
1512
+ var top = parseInt(h/2,10);
1513
+ var left = parseInt(w/2,10);
1514
+ clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
1515
+ }
1516
+ }
1517
+
1518
+ opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
1519
+
1520
+ var d = opts.cssBefore.clip.match(/(\d+)/g);
1521
+ var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
1522
+
1523
+ opts.before.push(function(curr, next, opts) {
1524
+ if (curr == next) return;
1525
+ var $curr = $(curr), $next = $(next);
1526
+ $.fn.smooth.commonReset(curr,next,opts,true,true,false);
1527
+ opts.cssAfter.display = 'block';
1528
+
1529
+ var step = 1, count = parseInt((opts.speedIn / 13),10) - 1;
1530
+ (function f() {
1531
+ var tt = t ? t - parseInt(step * (t/count),10) : 0;
1532
+ var ll = l ? l - parseInt(step * (l/count),10) : 0;
1533
+ var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h;
1534
+ var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w;
1535
+ $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
1536
+ (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
1537
+ })();
1538
+ });
1539
+ $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1540
+ opts.animIn = { left: 0 };
1541
+ opts.animOut = { left: 0 };
1542
+ };
1543
+
1544
+ })(jQuery);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: internet techies, slidervilla
3
  Tags: slider, slideshow, wordpress slider, content slider, posts slider,image slider, responsive slideshow, image Rotator, jquery slider, Photo Slider, nivo slider, slider plugin, javascript slider, coin slider, responsive slider, featured-content-slider, Horizontal slider, carousel slider, wp slider, vertical slider, best slider plugin, content slideshow, javascript slideshow, slideshow manager, slideshow plugin, image slideshow, jquery slideshow, wordpress slideshow, vertical slides, responsive, nivoslider, flex slider, coinslider, carousel, post, posts, plugin, slider widget, widget slider, widget slideshow, widget, widgets, seo, wordpress seo, media, page, slide, slides
4
  Donate link: http://www.clickonf5.org/go/smooth-slider/
5
  Requires at least: 3.0
6
- Tested up to: 4.0
7
- Stable tag: 2.6.4
8
  License: GPLv2 or later
9
 
10
  Most Popular Responsive WordPress Slider for Featured Content, Videos and Media Images
@@ -152,6 +152,12 @@ Check the other FAQs on Smooth [Slider Documetation on SliderVilla](http://guide
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
155
  Version 2.6.4 (09/10/2014)
156
 
157
  1. Fix: In case of multisite WordPress installation there was an issue while saving setting set.
3
  Tags: slider, slideshow, wordpress slider, content slider, posts slider,image slider, responsive slideshow, image Rotator, jquery slider, Photo Slider, nivo slider, slider plugin, javascript slider, coin slider, responsive slider, featured-content-slider, Horizontal slider, carousel slider, wp slider, vertical slider, best slider plugin, content slideshow, javascript slideshow, slideshow manager, slideshow plugin, image slideshow, jquery slideshow, wordpress slideshow, vertical slides, responsive, nivoslider, flex slider, coinslider, carousel, post, posts, plugin, slider widget, widget slider, widget slideshow, widget, widgets, seo, wordpress seo, media, page, slide, slides
4
  Donate link: http://www.clickonf5.org/go/smooth-slider/
5
  Requires at least: 3.0
6
+ Tested up to: 4.2
7
+ Stable tag: 2.6.5
8
  License: GPLv2 or later
9
 
10
  Most Popular Responsive WordPress Slider for Featured Content, Videos and Media Images
152
 
153
  == Changelog ==
154
 
155
+ Version 2.6.5 (09/19/2014)
156
+
157
+ 1. Fix: Conflict with Pointelle Slider
158
+ 2. Fix: Conflict with Logo Slider
159
+ 3. Fix: Small issue with Reposiveness on resizing Smooth Slider with border specified
160
+
161
  Version 2.6.4 (09/10/2014)
162
 
163
  1. Fix: In case of multisite WordPress installation there was an issue while saving setting set.
slider_versions/smooth_1.php CHANGED
@@ -192,8 +192,7 @@ global $smooth_slider;
192
  wp_register_script('jquery', false, false, false, false);
193
  wp_enqueue_script( 'jquery-ui-tabs' );
194
  wp_enqueue_script( 'jquery-ui-core' );
195
- wp_enqueue_script( 'jquery-ui-sortable' );
196
- //wp_enqueue_script( 'jquery.cycle', smooth_slider_plugin_url( 'js/jcycle.js' ),array('jquery'), SMOOTH_SLIDER_VER, false);
197
  wp_enqueue_script( 'smooth_slider_admin_js', smooth_slider_plugin_url( 'js/admin.js' ),
198
  array('jquery'), SMOOTH_SLIDER_VER, false);
199
  wp_enqueue_script( 'jquery.bpopup.min', smooth_slider_plugin_url( 'js/jquery.bpopup.min.js' ),'', SMOOTH_SLIDER_VER, false);
192
  wp_register_script('jquery', false, false, false, false);
193
  wp_enqueue_script( 'jquery-ui-tabs' );
194
  wp_enqueue_script( 'jquery-ui-core' );
195
+ wp_enqueue_script( 'jquery-ui-sortable' );
 
196
  wp_enqueue_script( 'smooth_slider_admin_js', smooth_slider_plugin_url( 'js/admin.js' ),
197
  array('jquery'), SMOOTH_SLIDER_VER, false);
198
  wp_enqueue_script( 'jquery.bpopup.min', smooth_slider_plugin_url( 'js/jquery.bpopup.min.js' ),'', SMOOTH_SLIDER_VER, false);
smooth-slider.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smooth Slider
4
  Plugin URI: http://slidervilla.com/smooth-slider/
5
  Description: Smooth slider adds a responsive featured content on image slider using shortcode, widget and template tags. Create and embed featured content slider, recent post slider, category slider in less than 60 seconds.
6
- Version: 2.6.4
7
  Author: SliderVilla
8
  Author URI: http://slidervilla.com/
9
  Wordpress version supported: 2.9 and above
@@ -30,12 +30,12 @@ Wordpress version supported: 2.9 and above
30
  //defined global variables and constants here
31
  global $smooth_slider,$default_slider,$smooth_db_version,$default_smooth_slider_settings;
32
  $smooth_slider = get_option('smooth_slider_options');
33
- $smooth_db_version='2.6.4'; //current version of smooth slider database
34
  define('SLIDER_TABLE','smooth_slider'); //Slider TABLE NAME
35
  define('PREV_SLIDER_TABLE','slider'); //Slider TABLE NAME
36
  define('SLIDER_META','smooth_slider_meta'); //Meta TABLE NAME
37
  define('SLIDER_POST_META','smooth_slider_postmeta'); //Meta TABLE NAME
38
- define("SMOOTH_SLIDER_VER","2.6.4",false);//Current Version of Smooth Slider
39
  if ( ! defined( 'SMOOTH_SLIDER_PLUGIN_BASENAME' ) )
40
  define( 'SMOOTH_SLIDER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
41
  if ( ! defined( 'SMOOTH_SLIDER_CSS_DIR' ) ){
3
  Plugin Name: Smooth Slider
4
  Plugin URI: http://slidervilla.com/smooth-slider/
5
  Description: Smooth slider adds a responsive featured content on image slider using shortcode, widget and template tags. Create and embed featured content slider, recent post slider, category slider in less than 60 seconds.
6
+ Version: 2.6.5
7
  Author: SliderVilla
8
  Author URI: http://slidervilla.com/
9
  Wordpress version supported: 2.9 and above
30
  //defined global variables and constants here
31
  global $smooth_slider,$default_slider,$smooth_db_version,$default_smooth_slider_settings;
32
  $smooth_slider = get_option('smooth_slider_options');
33
+ $smooth_db_version='2.6.5'; //current version of smooth slider database
34
  define('SLIDER_TABLE','smooth_slider'); //Slider TABLE NAME
35
  define('PREV_SLIDER_TABLE','slider'); //Slider TABLE NAME
36
  define('SLIDER_META','smooth_slider_meta'); //Meta TABLE NAME
37
  define('SLIDER_POST_META','smooth_slider_postmeta'); //Meta TABLE NAME
38
+ define("SMOOTH_SLIDER_VER","2.6.5",false);//Current Version of Smooth Slider
39
  if ( ! defined( 'SMOOTH_SLIDER_PLUGIN_BASENAME' ) )
40
  define( 'SMOOTH_SLIDER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
41
  if ( ! defined( 'SMOOTH_SLIDER_CSS_DIR' ) ){