Meteor Slides - Version 1.1

Version Description

  • Added slideshow widget, added stylesheet, updated JQuery Cycle to 2.88.
Download this release

Release Info

Developer jleuze
Plugin Icon 128x128 Meteor Slides
Version 1.1
Comparing to
See all releases

Code changes from version 1.0.2 to 1.1

css/meteor-slides-admin.css CHANGED
@@ -1,3 +1,5 @@
 
 
1
  #wpwrap #icon-edit {
2
  background: url('../images/slides-icon-32x32.png') no-repeat top left;
3
  }
1
+ /* Stylesheet for the Meteor Slides admin pages */
2
+
3
  #wpwrap #icon-edit {
4
  background: url('../images/slides-icon-32x32.png') no-repeat top left;
5
  }
css/meteor-slides.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Stylesheet for the Meteor Slides slideshow
2
+
3
+ Copy "meteor-slides.css" to your theme's directory to replace this stylesheet
4
+
5
+ */
6
+
7
+ #meteor-slideshow {
8
+ margin: 0;
9
+ padding: 0;
10
+ z-index: 1;
11
+ overflow: hidden;
12
+ }
13
+
14
+ #meteor-slideshow .slide a img {
15
+ margin: 0;
16
+ padding: 0;
17
+ border: 0;
18
+ }
19
+
20
+ #meteor-slideshow .slide img {
21
+ margin: 0;
22
+ padding: 0;
23
+ border: 0;
24
+ }
js/jquery.cycle.all.js CHANGED
@@ -1,1304 +1,1331 @@
1
- /*!
2
- * jQuery Cycle Plugin (with Transition Definitions)
3
- * Examples and documentation at: http://jquery.malsup.com/cycle/
4
- * Copyright (c) 2007-2010 M. Alsup
5
- * Version: 2.86 (05-APR-2010)
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl.html
9
- * Requires: jQuery v1.2.6 or later
10
- */
11
- ;(function($) {
12
-
13
- var ver = '2.86';
14
-
15
- // if $.support is not defined (pre jQuery 1.3) add what I need
16
- if ($.support == undefined) {
17
- $.support = {
18
- opacity: !($.browser.msie)
19
- };
20
- }
21
-
22
- function debug(s) {
23
- if ($.fn.cycle.debug)
24
- log(s);
25
- }
26
- function log() {
27
- if (window.console && window.console.log)
28
- window.console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
29
- };
30
-
31
- // the options arg can be...
32
- // a number - indicates an immediate transition should occur to the given slide index
33
- // a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
34
- // an object - properties to control the slideshow
35
- //
36
- // the arg2 arg can be...
37
- // the name of an fx (only used in conjunction with a numeric value for 'options')
38
- // the value true (only used in first arg == 'resume') and indicates
39
- // that the resume should occur immediately (not wait for next timeout)
40
-
41
- $.fn.cycle = function(options, arg2) {
42
- var o = { s: this.selector, c: this.context };
43
-
44
- // in 1.3+ we can fix mistakes with the ready state
45
- if (this.length === 0 && options != 'stop') {
46
- if (!$.isReady && o.s) {
47
- log('DOM not ready, queuing slideshow');
48
- $(function() {
49
- $(o.s,o.c).cycle(options,arg2);
50
- });
51
- return this;
52
- }
53
- // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
54
- log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
55
- return this;
56
- }
57
-
58
- // iterate the matched nodeset
59
- return this.each(function() {
60
- var opts = handleArguments(this, options, arg2);
61
- if (opts === false)
62
- return;
63
-
64
- opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;
65
-
66
- // stop existing slideshow for this container (if there is one)
67
- if (this.cycleTimeout)
68
- clearTimeout(this.cycleTimeout);
69
- this.cycleTimeout = this.cyclePause = 0;
70
-
71
- var $cont = $(this);
72
- var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
73
- var els = $slides.get();
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(opts2.currSlide, opts2.nextSlide, opts2, !opts2.rev);
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,!opts2.rev)}, startTime);
92
- }
93
- });
94
- };
95
-
96
- // process the args that were passed to the plugin fn
97
- function handleArguments(cont, options, arg2) {
98
- if (cont.cycleStop == undefined)
99
- cont.cycleStop = 0;
100
- if (options === undefined || options === null)
101
- options = {};
102
- if (options.constructor == String) {
103
- switch(options) {
104
- case 'destroy':
105
- case 'stop':
106
- var opts = $(cont).data('cycle.opts');
107
- if (!opts)
108
- return false;
109
- cont.cycleStop++; // callbacks look for change
110
- if (cont.cycleTimeout)
111
- clearTimeout(cont.cycleTimeout);
112
- cont.cycleTimeout = 0;
113
- $(cont).removeData('cycle.opts');
114
- if (options == 'destroy')
115
- destroy(opts);
116
- return false;
117
- case 'toggle':
118
- cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
119
- checkInstantResume(cont.cyclePause, arg2, cont);
120
- return false;
121
- case 'pause':
122
- cont.cyclePause = 1;
123
- return false;
124
- case 'resume':
125
- cont.cyclePause = 0;
126
- checkInstantResume(false, arg2, cont);
127
- return false;
128
- case 'prev':
129
- case 'next':
130
- var opts = $(cont).data('cycle.opts');
131
- if (!opts) {
132
- log('options not found, "prev/next" ignored');
133
- return false;
134
- }
135
- $.fn.cycle[options](opts);
136
- return false;
137
- default:
138
- options = { fx: options };
139
- };
140
- return options;
141
- }
142
- else if (options.constructor == Number) {
143
- // go to the requested slide
144
- var num = options;
145
- options = $(cont).data('cycle.opts');
146
- if (!options) {
147
- log('options not found, can not advance slide');
148
- return false;
149
- }
150
- if (num < 0 || num >= options.elements.length) {
151
- log('invalid slide index: ' + num);
152
- return false;
153
- }
154
- options.nextSlide = num;
155
- if (cont.cycleTimeout) {
156
- clearTimeout(cont.cycleTimeout);
157
- cont.cycleTimeout = 0;
158
- }
159
- if (typeof arg2 == 'string')
160
- options.oneTimeFx = arg2;
161
- go(options.elements, options, 1, num >= options.currSlide);
162
- return false;
163
- }
164
- return options;
165
-
166
- function checkInstantResume(isPaused, arg2, cont) {
167
- if (!isPaused && arg2 === true) { // resume now!
168
- var options = $(cont).data('cycle.opts');
169
- if (!options) {
170
- log('options not found, can not resume');
171
- return false;
172
- }
173
- if (cont.cycleTimeout) {
174
- clearTimeout(cont.cycleTimeout);
175
- cont.cycleTimeout = 0;
176
- }
177
- go(options.elements, options, 1, 1);
178
- }
179
- }
180
- };
181
-
182
- function removeFilter(el, opts) {
183
- if (!$.support.opacity && opts.cleartype && el.style.filter) {
184
- try { el.style.removeAttribute('filter'); }
185
- catch(smother) {} // handle old opera versions
186
- }
187
- };
188
-
189
- // unbind event handlers
190
- function destroy(opts) {
191
- if (opts.next)
192
- $(opts.next).unbind(opts.prevNextEvent);
193
- if (opts.prev)
194
- $(opts.prev).unbind(opts.prevNextEvent);
195
-
196
- if (opts.pager || opts.pagerAnchorBuilder)
197
- $.each(opts.pagerAnchors || [], function() {
198
- this.unbind().remove();
199
- });
200
- opts.pagerAnchors = null;
201
- if (opts.destroy) // callback
202
- opts.destroy(opts);
203
- };
204
-
205
- // one-time initialization
206
- function buildOptions($cont, $slides, els, options, o) {
207
- // support metadata plugin (v1.0 and v2.0)
208
- var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
209
- if (opts.autostop)
210
- opts.countdown = opts.autostopCount || els.length;
211
-
212
- var cont = $cont[0];
213
- $cont.data('cycle.opts', opts);
214
- opts.$cont = $cont;
215
- opts.stopCount = cont.cycleStop;
216
- opts.elements = els;
217
- opts.before = opts.before ? [opts.before] : [];
218
- opts.after = opts.after ? [opts.after] : [];
219
- opts.after.unshift(function(){ opts.busy=0; });
220
-
221
- // push some after callbacks
222
- if (!$.support.opacity && opts.cleartype)
223
- opts.after.push(function() { removeFilter(this, opts); });
224
- if (opts.continuous)
225
- opts.after.push(function() { go(els,opts,0,!opts.rev); });
226
-
227
- saveOriginalOpts(opts);
228
-
229
- // clearType corrections
230
- if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
231
- clearTypeFix($slides);
232
-
233
- // container requires non-static position so that slides can be position within
234
- if ($cont.css('position') == 'static')
235
- $cont.css('position', 'relative');
236
- if (opts.width)
237
- $cont.width(opts.width);
238
- if (opts.height && opts.height != 'auto')
239
- $cont.height(opts.height);
240
-
241
- if (opts.startingSlide)
242
- opts.startingSlide = parseInt(opts.startingSlide);
243
-
244
- // if random, mix up the slide array
245
- if (opts.random) {
246
- opts.randomMap = [];
247
- for (var i = 0; i < els.length; i++)
248
- opts.randomMap.push(i);
249
- opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
250
- opts.randomIndex = 1;
251
- opts.startingSlide = opts.randomMap[1];
252
- }
253
- else if (opts.startingSlide >= els.length)
254
- opts.startingSlide = 0; // catch bogus input
255
- opts.currSlide = opts.startingSlide || 0;
256
- var first = opts.startingSlide;
257
-
258
- // set position and zIndex on all the slides
259
- $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
260
- var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
261
- $(this).css('z-index', z)
262
- });
263
-
264
- // make sure first slide is visible
265
- $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
266
- removeFilter(els[first], opts);
267
-
268
- // stretch slides
269
- if (opts.fit && opts.width)
270
- $slides.width(opts.width);
271
- if (opts.fit && opts.height && opts.height != 'auto')
272
- $slides.height(opts.height);
273
-
274
- // stretch container
275
- var reshape = opts.containerResize && !$cont.innerHeight();
276
- if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
277
- var maxw = 0, maxh = 0;
278
- for(var j=0; j < els.length; j++) {
279
- var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
280
- if (!w) w = e.offsetWidth || e.width || $e.attr('width')
281
- if (!h) h = e.offsetHeight || e.height || $e.attr('height');
282
- maxw = w > maxw ? w : maxw;
283
- maxh = h > maxh ? h : maxh;
284
- }
285
- if (maxw > 0 && maxh > 0)
286
- $cont.css({width:maxw+'px',height:maxh+'px'});
287
- }
288
-
289
- if (opts.pause)
290
- $cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});
291
-
292
- if (supportMultiTransitions(opts) === false)
293
- return false;
294
-
295
- // apparently a lot of people use image slideshows without height/width attributes on the images.
296
- // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
297
- var requeue = false;
298
- options.requeueAttempts = options.requeueAttempts || 0;
299
- $slides.each(function() {
300
- // try to get height/width of each slide
301
- var $el = $(this);
302
- this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
303
- this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
304
-
305
- if ( $el.is('img') ) {
306
- // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when
307
- // an image is being downloaded and the markup did not include sizing info (height/width attributes);
308
- // there seems to be some "default" sizes used in this situation
309
- var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
310
- var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete);
311
- var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
312
- var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);
313
- // don't requeue for images that are still loading but have a valid size
314
- if (loadingIE || loadingFF || loadingOp || loadingOther) {
315
- if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
316
- log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
317
- setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout);
318
- requeue = true;
319
- return false; // break each loop
320
- }
321
- else {
322
- log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
323
- }
324
- }
325
- }
326
- return true;
327
- });
328
-
329
- if (requeue)
330
- return false;
331
-
332
- opts.cssBefore = opts.cssBefore || {};
333
- opts.animIn = opts.animIn || {};
334
- opts.animOut = opts.animOut || {};
335
-
336
- $slides.not(':eq('+first+')').css(opts.cssBefore);
337
- if (opts.cssFirst)
338
- $($slides[first]).css(opts.cssFirst);
339
-
340
- if (opts.timeout) {
341
- opts.timeout = parseInt(opts.timeout);
342
- // ensure that timeout and speed settings are sane
343
- if (opts.speed.constructor == String)
344
- opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed);
345
- if (!opts.sync)
346
- opts.speed = opts.speed / 2;
347
-
348
- var buffer = opts.fx == 'shuffle' ? 500 : 250;
349
- while((opts.timeout - opts.speed) < buffer) // sanitize timeout
350
- opts.timeout += opts.speed;
351
- }
352
- if (opts.easing)
353
- opts.easeIn = opts.easeOut = opts.easing;
354
- if (!opts.speedIn)
355
- opts.speedIn = opts.speed;
356
- if (!opts.speedOut)
357
- opts.speedOut = opts.speed;
358
-
359
- opts.slideCount = els.length;
360
- opts.currSlide = opts.lastSlide = first;
361
- if (opts.random) {
362
- if (++opts.randomIndex == els.length)
363
- opts.randomIndex = 0;
364
- opts.nextSlide = opts.randomMap[opts.randomIndex];
365
- }
366
- else
367
- opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
368
-
369
- // run transition init fn
370
- if (!opts.multiFx) {
371
- var init = $.fn.cycle.transitions[opts.fx];
372
- if ($.isFunction(init))
373
- init($cont, $slides, opts);
374
- else if (opts.fx != 'custom' && !opts.multiFx) {
375
- log('unknown transition: ' + opts.fx,'; slideshow terminating');
376
- return false;
377
- }
378
- }
379
-
380
- // fire artificial events
381
- var e0 = $slides[first];
382
- if (opts.before.length)
383
- opts.before[0].apply(e0, [e0, e0, opts, true]);
384
- if (opts.after.length > 1)
385
- opts.after[1].apply(e0, [e0, e0, opts, true]);
386
-
387
- if (opts.next)
388
- $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1)});
389
- if (opts.prev)
390
- $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1)});
391
- if (opts.pager || opts.pagerAnchorBuilder)
392
- buildPager(els,opts);
393
-
394
- exposeAddSlide(opts, els);
395
-
396
- return opts;
397
- };
398
-
399
- // save off original opts so we can restore after clearing state
400
- function saveOriginalOpts(opts) {
401
- opts.original = { before: [], after: [] };
402
- opts.original.cssBefore = $.extend({}, opts.cssBefore);
403
- opts.original.cssAfter = $.extend({}, opts.cssAfter);
404
- opts.original.animIn = $.extend({}, opts.animIn);
405
- opts.original.animOut = $.extend({}, opts.animOut);
406
- $.each(opts.before, function() { opts.original.before.push(this); });
407
- $.each(opts.after, function() { opts.original.after.push(this); });
408
- };
409
-
410
- function supportMultiTransitions(opts) {
411
- var i, tx, txs = $.fn.cycle.transitions;
412
- // look for multiple effects
413
- if (opts.fx.indexOf(',') > 0) {
414
- opts.multiFx = true;
415
- opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
416
- // discard any bogus effect names
417
- for (i=0; i < opts.fxs.length; i++) {
418
- var fx = opts.fxs[i];
419
- tx = txs[fx];
420
- if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
421
- log('discarding unknown transition: ',fx);
422
- opts.fxs.splice(i,1);
423
- i--;
424
- }
425
- }
426
- // if we have an empty list then we threw everything away!
427
- if (!opts.fxs.length) {
428
- log('No valid transitions named; slideshow terminating.');
429
- return false;
430
- }
431
- }
432
- else if (opts.fx == 'all') { // auto-gen the list of transitions
433
- opts.multiFx = true;
434
- opts.fxs = [];
435
- for (p in txs) {
436
- tx = txs[p];
437
- if (txs.hasOwnProperty(p) && $.isFunction(tx))
438
- opts.fxs.push(p);
439
- }
440
- }
441
- if (opts.multiFx && opts.randomizeEffects) {
442
- // munge the fxs array to make effect selection random
443
- var r1 = Math.floor(Math.random() * 20) + 30;
444
- for (i = 0; i < r1; i++) {
445
- var r2 = Math.floor(Math.random() * opts.fxs.length);
446
- opts.fxs.push(opts.fxs.splice(r2,1)[0]);
447
- }
448
- debug('randomized fx sequence: ',opts.fxs);
449
- }
450
- return true;
451
- };
452
-
453
- // provide a mechanism for adding slides after the slideshow has started
454
- function exposeAddSlide(opts, els) {
455
- opts.addSlide = function(newSlide, prepend) {
456
- var $s = $(newSlide), s = $s[0];
457
- if (!opts.autostopCount)
458
- opts.countdown++;
459
- els[prepend?'unshift':'push'](s);
460
- if (opts.els)
461
- opts.els[prepend?'unshift':'push'](s); // shuffle needs this
462
- opts.slideCount = els.length;
463
-
464
- $s.css('position','absolute');
465
- $s[prepend?'prependTo':'appendTo'](opts.$cont);
466
-
467
- if (prepend) {
468
- opts.currSlide++;
469
- opts.nextSlide++;
470
- }
471
-
472
- if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
473
- clearTypeFix($s);
474
-
475
- if (opts.fit && opts.width)
476
- $s.width(opts.width);
477
- if (opts.fit && opts.height && opts.height != 'auto')
478
- $slides.height(opts.height);
479
- s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
480
- s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
481
-
482
- $s.css(opts.cssBefore);
483
-
484
- if (opts.pager || opts.pagerAnchorBuilder)
485
- $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
486
-
487
- if ($.isFunction(opts.onAddSlide))
488
- opts.onAddSlide($s);
489
- else
490
- $s.hide(); // default behavior
491
- };
492
- }
493
-
494
- // reset internal state; we do this on every pass in order to support multiple effects
495
- $.fn.cycle.resetState = function(opts, fx) {
496
- fx = fx || opts.fx;
497
- opts.before = []; opts.after = [];
498
- opts.cssBefore = $.extend({}, opts.original.cssBefore);
499
- opts.cssAfter = $.extend({}, opts.original.cssAfter);
500
- opts.animIn = $.extend({}, opts.original.animIn);
501
- opts.animOut = $.extend({}, opts.original.animOut);
502
- opts.fxFn = null;
503
- $.each(opts.original.before, function() { opts.before.push(this); });
504
- $.each(opts.original.after, function() { opts.after.push(this); });
505
-
506
- // re-init
507
- var init = $.fn.cycle.transitions[fx];
508
- if ($.isFunction(init))
509
- init(opts.$cont, $(opts.elements), opts);
510
- };
511
-
512
- // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
513
- function go(els, opts, manual, fwd) {
514
- // opts.busy is true if we're in the middle of an animation
515
- if (manual && opts.busy && opts.manualTrump) {
516
- // let manual transitions requests trump active ones
517
- debug('manualTrump in go(), stopping active transition');
518
- $(els).stop(true,true);
519
- opts.busy = false;
520
- }
521
- // don't begin another timeout-based transition if there is one active
522
- if (opts.busy) {
523
- debug('transition active, ignoring new tx request');
524
- return;
525
- }
526
-
527
- var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
528
-
529
- // stop cycling if we have an outstanding stop request
530
- if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
531
- return;
532
-
533
- // check to see if we should stop cycling based on autostop options
534
- if (!manual && !p.cyclePause &&
535
- ((opts.autostop && (--opts.countdown <= 0)) ||
536
- (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
537
- if (opts.end)
538
- opts.end(opts);
539
- return;
540
- }
541
-
542
- // if slideshow is paused, only transition on a manual trigger
543
- var changed = false;
544
- if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
545
- changed = true;
546
- var fx = opts.fx;
547
- // keep trying to get the slide size if we don't have it yet
548
- curr.cycleH = curr.cycleH || $(curr).height();
549
- curr.cycleW = curr.cycleW || $(curr).width();
550
- next.cycleH = next.cycleH || $(next).height();
551
- next.cycleW = next.cycleW || $(next).width();
552
-
553
- // support multiple transition types
554
- if (opts.multiFx) {
555
- if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length)
556
- opts.lastFx = 0;
557
- fx = opts.fxs[opts.lastFx];
558
- opts.currFx = fx;
559
- }
560
-
561
- // one-time fx overrides apply to: $('div').cycle(3,'zoom');
562
- if (opts.oneTimeFx) {
563
- fx = opts.oneTimeFx;
564
- opts.oneTimeFx = null;
565
- }
566
-
567
- $.fn.cycle.resetState(opts, fx);
568
-
569
- // run the before callbacks
570
- if (opts.before.length)
571
- $.each(opts.before, function(i,o) {
572
- if (p.cycleStop != opts.stopCount) return;
573
- o.apply(next, [curr, next, opts, fwd]);
574
- });
575
-
576
- // stage the after callacks
577
- var after = function() {
578
- $.each(opts.after, function(i,o) {
579
- if (p.cycleStop != opts.stopCount) return;
580
- o.apply(next, [curr, next, opts, fwd]);
581
- });
582
- };
583
-
584
- debug('tx firing; currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
585
-
586
- // get ready to perform the transition
587
- opts.busy = 1;
588
- if (opts.fxFn) // fx function provided?
589
- opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
590
- else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
591
- $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
592
- else
593
- $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
594
- }
595
-
596
- if (changed || opts.nextSlide == opts.currSlide) {
597
- // calculate the next slide
598
- opts.lastSlide = opts.currSlide;
599
- if (opts.random) {
600
- opts.currSlide = opts.nextSlide;
601
- if (++opts.randomIndex == els.length)
602
- opts.randomIndex = 0;
603
- opts.nextSlide = opts.randomMap[opts.randomIndex];
604
- if (opts.nextSlide == opts.currSlide)
605
- opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
606
- }
607
- else { // sequence
608
- var roll = (opts.nextSlide + 1) == els.length;
609
- opts.nextSlide = roll ? 0 : opts.nextSlide+1;
610
- opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
611
- }
612
- }
613
- if (changed && opts.pager)
614
- opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
615
-
616
- // stage the next transition
617
- var ms = 0;
618
- if (opts.timeout && !opts.continuous)
619
- ms = getTimeout(curr, next, opts, fwd);
620
- else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
621
- ms = 10;
622
- if (ms > 0)
623
- p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.rev) }, ms);
624
- };
625
-
626
- // invoked after transition
627
- $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
628
- $(pager).each(function() {
629
- $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
630
- });
631
- };
632
-
633
- // calculate timeout value for current transition
634
- function getTimeout(curr, next, opts, fwd) {
635
- if (opts.timeoutFn) {
636
- // call user provided calc fn
637
- var t = opts.timeoutFn(curr,next,opts,fwd);
638
- while ((t - opts.speed) < 250) // sanitize timeout
639
- t += opts.speed;
640
- debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
641
- if (t !== false)
642
- return t;
643
- }
644
- return opts.timeout;
645
- };
646
-
647
- // expose next/prev function, caller must pass in state
648
- $.fn.cycle.next = function(opts) { advance(opts, opts.rev?-1:1); };
649
- $.fn.cycle.prev = function(opts) { advance(opts, opts.rev?1:-1);};
650
-
651
- // advance slide forward or back
652
- function advance(opts, val) {
653
- var els = opts.elements;
654
- var p = opts.$cont[0], timeout = p.cycleTimeout;
655
- if (timeout) {
656
- clearTimeout(timeout);
657
- p.cycleTimeout = 0;
658
- }
659
- if (opts.random && val < 0) {
660
- // move back to the previously display slide
661
- opts.randomIndex--;
662
- if (--opts.randomIndex == -2)
663
- opts.randomIndex = els.length-2;
664
- else if (opts.randomIndex == -1)
665
- opts.randomIndex = els.length-1;
666
- opts.nextSlide = opts.randomMap[opts.randomIndex];
667
- }
668
- else if (opts.random) {
669
- opts.nextSlide = opts.randomMap[opts.randomIndex];
670
- }
671
- else {
672
- opts.nextSlide = opts.currSlide + val;
673
- if (opts.nextSlide < 0) {
674
- if (opts.nowrap) return false;
675
- opts.nextSlide = els.length - 1;
676
- }
677
- else if (opts.nextSlide >= els.length) {
678
- if (opts.nowrap) return false;
679
- opts.nextSlide = 0;
680
- }
681
- }
682
-
683
- var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
684
- if ($.isFunction(cb))
685
- cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
686
- go(els, opts, 1, val>=0);
687
- return false;
688
- };
689
-
690
- function buildPager(els, opts) {
691
- var $p = $(opts.pager);
692
- $.each(els, function(i,o) {
693
- $.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
694
- });
695
- opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
696
- };
697
-
698
- $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
699
- var a;
700
- if ($.isFunction(opts.pagerAnchorBuilder)) {
701
- a = opts.pagerAnchorBuilder(i,el);
702
- debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
703
- }
704
- else
705
- a = '<a href="#">'+(i+1)+'</a>';
706
-
707
- if (!a)
708
- return;
709
- var $a = $(a);
710
- // don't reparent if anchor is in the dom
711
- if ($a.parents('body').length === 0) {
712
- var arr = [];
713
- if ($p.length > 1) {
714
- $p.each(function() {
715
- var $clone = $a.clone(true);
716
- $(this).append($clone);
717
- arr.push($clone[0]);
718
- });
719
- $a = $(arr);
720
- }
721
- else {
722
- $a.appendTo($p);
723
- }
724
- }
725
-
726
- opts.pagerAnchors = opts.pagerAnchors || [];
727
- opts.pagerAnchors.push($a);
728
- $a.bind(opts.pagerEvent, function(e) {
729
- e.preventDefault();
730
- opts.nextSlide = i;
731
- var p = opts.$cont[0], timeout = p.cycleTimeout;
732
- if (timeout) {
733
- clearTimeout(timeout);
734
- p.cycleTimeout = 0;
735
- }
736
- var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
737
- if ($.isFunction(cb))
738
- cb(opts.nextSlide, els[opts.nextSlide]);
739
- go(els,opts,1,opts.currSlide < i); // trigger the trans
740
- // return false; // <== allow bubble
741
- });
742
-
743
- if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
744
- $a.bind('click.cycle', function(){return false;}); // suppress click
745
-
746
- if (opts.pauseOnPagerHover)
747
- $a.hover(function() { opts.$cont[0].cyclePause++; }, function() { opts.$cont[0].cyclePause--; } );
748
- };
749
-
750
- // helper fn to calculate the number of slides between the current and the next
751
- $.fn.cycle.hopsFromLast = function(opts, fwd) {
752
- var hops, l = opts.lastSlide, c = opts.currSlide;
753
- if (fwd)
754
- hops = c > l ? c - l : opts.slideCount - l;
755
- else
756
- hops = c < l ? l - c : l + opts.slideCount - c;
757
- return hops;
758
- };
759
-
760
- // fix clearType problems in ie6 by setting an explicit bg color
761
- // (otherwise text slides look horrible during a fade transition)
762
- function clearTypeFix($slides) {
763
- debug('applying clearType background-color hack');
764
- function hex(s) {
765
- s = parseInt(s).toString(16);
766
- return s.length < 2 ? '0'+s : s;
767
- };
768
- function getBg(e) {
769
- for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
770
- var v = $.css(e,'background-color');
771
- if (v.indexOf('rgb') >= 0 ) {
772
- var rgb = v.match(/\d+/g);
773
- return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
774
- }
775
- if (v && v != 'transparent')
776
- return v;
777
- }
778
- return '#ffffff';
779
- };
780
- $slides.each(function() { $(this).css('background-color', getBg(this)); });
781
- };
782
-
783
- // reset common props before the next transition
784
- $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
785
- $(opts.elements).not(curr).hide();
786
- opts.cssBefore.opacity = 1;
787
- opts.cssBefore.display = 'block';
788
- if (w !== false && next.cycleW > 0)
789
- opts.cssBefore.width = next.cycleW;
790
- if (h !== false && next.cycleH > 0)
791
- opts.cssBefore.height = next.cycleH;
792
- opts.cssAfter = opts.cssAfter || {};
793
- opts.cssAfter.display = 'none';
794
- $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
795
- $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
796
- };
797
-
798
- // the actual fn for effecting a transition
799
- $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
800
- var $l = $(curr), $n = $(next);
801
- var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
802
- $n.css(opts.cssBefore);
803
- if (speedOverride) {
804
- if (typeof speedOverride == 'number')
805
- speedIn = speedOut = speedOverride;
806
- else
807
- speedIn = speedOut = 1;
808
- easeIn = easeOut = null;
809
- }
810
- var fn = function() {$n.animate(opts.animIn, speedIn, easeIn, cb)};
811
- $l.animate(opts.animOut, speedOut, easeOut, function() {
812
- if (opts.cssAfter) $l.css(opts.cssAfter);
813
- if (!opts.sync) fn();
814
- });
815
- if (opts.sync) fn();
816
- };
817
-
818
- // transition definitions - only fade is defined here, transition pack defines the rest
819
- $.fn.cycle.transitions = {
820
- fade: function($cont, $slides, opts) {
821
- $slides.not(':eq('+opts.currSlide+')').css('opacity',0);
822
- opts.before.push(function(curr,next,opts) {
823
- $.fn.cycle.commonReset(curr,next,opts);
824
- opts.cssBefore.opacity = 0;
825
- });
826
- opts.animIn = { opacity: 1 };
827
- opts.animOut = { opacity: 0 };
828
- opts.cssBefore = { top: 0, left: 0 };
829
- }
830
- };
831
-
832
- $.fn.cycle.ver = function() { return ver; };
833
-
834
- // override these globally if you like (they are all optional)
835
- $.fn.cycle.defaults = {
836
- fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
837
- timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
838
- timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
839
- continuous: 0, // true to start next transition immediately after current one completes
840
- speed: 1000, // speed of the transition (any valid fx speed value)
841
- speedIn: null, // speed of the 'in' transition
842
- speedOut: null, // speed of the 'out' transition
843
- next: null, // selector for element to use as event trigger for next slide
844
- prev: null, // selector for element to use as event trigger for previous slide
845
- // prevNextClick: null, // @deprecated; please use onPrevNextEvent instead
846
- onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
847
- prevNextEvent:'click.cycle',// event which drives the manual transition to the previous or next slide
848
- pager: null, // selector for element to use as pager container
849
- //pagerClick null, // @deprecated; please use onPagerEvent instead
850
- onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
851
- pagerEvent: 'click.cycle', // name of event which drives the pager navigation
852
- allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
853
- pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement)
854
- before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
855
- after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
856
- end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
857
- easing: null, // easing method for both in and out transitions
858
- easeIn: null, // easing for "in" transition
859
- easeOut: null, // easing for "out" transition
860
- shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
861
- animIn: null, // properties that define how the slide animates in
862
- animOut: null, // properties that define how the slide animates out
863
- cssBefore: null, // properties that define the initial state of the slide before transitioning in
864
- cssAfter: null, // properties that defined the state of the slide after transitioning out
865
- fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
866
- height: 'auto', // container height
867
- startingSlide: 0, // zero-based index of the first slide to be displayed
868
- sync: 1, // true if in/out transitions should occur simultaneously
869
- random: 0, // true for random, false for sequence (not applicable to shuffle fx)
870
- fit: 0, // force slides to fit container
871
- containerResize: 1, // resize container to fit largest slide
872
- pause: 0, // true to enable "pause on hover"
873
- pauseOnPagerHover: 0, // true to pause when hovering over pager link
874
- autostop: 0, // true to end slideshow after X transitions (where X == slide count)
875
- autostopCount: 0, // number of transitions (optionally used with autostop to define X)
876
- delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
877
- slideExpr: null, // expression for selecting slides (if something other than all children is required)
878
- cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE)
879
- cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
880
- nowrap: 0, // true to prevent slideshow from wrapping
881
- fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
882
- randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random
883
- rev: 0, // causes animations to transition in reverse
884
- manualTrump: true, // causes manual transition to stop an active transition instead of being ignored
885
- requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
886
- requeueTimeout: 250, // ms delay for requeue
887
- activePagerClass: 'activeSlide', // class name used for the active pager link
888
- updateActivePagerLink: null // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
889
- };
890
-
891
- })(jQuery);
892
-
893
-
894
- /*!
895
- * jQuery Cycle Plugin Transition Definitions
896
- * This script is a plugin for the jQuery Cycle Plugin
897
- * Examples and documentation at: http://malsup.com/jquery/cycle/
898
- * Copyright (c) 2007-2008 M. Alsup
899
- * Version: 2.72
900
- * Dual licensed under the MIT and GPL licenses:
901
- * http://www.opensource.org/licenses/mit-license.php
902
- * http://www.gnu.org/licenses/gpl.html
903
- */
904
- (function($) {
905
-
906
- //
907
- // These functions define one-time slide initialization for the named
908
- // transitions. To save file size feel free to remove any of these that you
909
- // don't need.
910
- //
911
- $.fn.cycle.transitions.none = function($cont, $slides, opts) {
912
- opts.fxFn = function(curr,next,opts,after){
913
- $(next).show();
914
- $(curr).hide();
915
- after();
916
- };
917
- }
918
-
919
- // scrollUp/Down/Left/Right
920
- $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
921
- $cont.css('overflow','hidden');
922
- opts.before.push($.fn.cycle.commonReset);
923
- var h = $cont.height();
924
- opts.cssBefore ={ top: h, left: 0 };
925
- opts.cssFirst = { top: 0 };
926
- opts.animIn = { top: 0 };
927
- opts.animOut = { top: -h };
928
- };
929
- $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
930
- $cont.css('overflow','hidden');
931
- opts.before.push($.fn.cycle.commonReset);
932
- var h = $cont.height();
933
- opts.cssFirst = { top: 0 };
934
- opts.cssBefore= { top: -h, left: 0 };
935
- opts.animIn = { top: 0 };
936
- opts.animOut = { top: h };
937
- };
938
- $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
939
- $cont.css('overflow','hidden');
940
- opts.before.push($.fn.cycle.commonReset);
941
- var w = $cont.width();
942
- opts.cssFirst = { left: 0 };
943
- opts.cssBefore= { left: w, top: 0 };
944
- opts.animIn = { left: 0 };
945
- opts.animOut = { left: 0-w };
946
- };
947
- $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
948
- $cont.css('overflow','hidden');
949
- opts.before.push($.fn.cycle.commonReset);
950
- var w = $cont.width();
951
- opts.cssFirst = { left: 0 };
952
- opts.cssBefore= { left: -w, top: 0 };
953
- opts.animIn = { left: 0 };
954
- opts.animOut = { left: w };
955
- };
956
- $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
957
- $cont.css('overflow','hidden').width();
958
- opts.before.push(function(curr, next, opts, fwd) {
959
- $.fn.cycle.commonReset(curr,next,opts);
960
- opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
961
- opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
962
- });
963
- opts.cssFirst = { left: 0 };
964
- opts.cssBefore= { top: 0 };
965
- opts.animIn = { left: 0 };
966
- opts.animOut = { top: 0 };
967
- };
968
- $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
969
- $cont.css('overflow','hidden');
970
- opts.before.push(function(curr, next, opts, fwd) {
971
- $.fn.cycle.commonReset(curr,next,opts);
972
- opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
973
- opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
974
- });
975
- opts.cssFirst = { top: 0 };
976
- opts.cssBefore= { left: 0 };
977
- opts.animIn = { top: 0 };
978
- opts.animOut = { left: 0 };
979
- };
980
-
981
- // slideX/slideY
982
- $.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
983
- opts.before.push(function(curr, next, opts) {
984
- $(opts.elements).not(curr).hide();
985
- $.fn.cycle.commonReset(curr,next,opts,false,true);
986
- opts.animIn.width = next.cycleW;
987
- });
988
- opts.cssBefore = { left: 0, top: 0, width: 0 };
989
- opts.animIn = { width: 'show' };
990
- opts.animOut = { width: 0 };
991
- };
992
- $.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
993
- opts.before.push(function(curr, next, opts) {
994
- $(opts.elements).not(curr).hide();
995
- $.fn.cycle.commonReset(curr,next,opts,true,false);
996
- opts.animIn.height = next.cycleH;
997
- });
998
- opts.cssBefore = { left: 0, top: 0, height: 0 };
999
- opts.animIn = { height: 'show' };
1000
- opts.animOut = { height: 0 };
1001
- };
1002
-
1003
- // shuffle
1004
- $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
1005
- var i, w = $cont.css('overflow', 'visible').width();
1006
- $slides.css({left: 0, top: 0});
1007
- opts.before.push(function(curr,next,opts) {
1008
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1009
- });
1010
- // only adjust speed once!
1011
- if (!opts.speedAdjusted) {
1012
- opts.speed = opts.speed / 2; // shuffle has 2 transitions
1013
- opts.speedAdjusted = true;
1014
- }
1015
- opts.random = 0;
1016
- opts.shuffle = opts.shuffle || {left:-w, top:15};
1017
- opts.els = [];
1018
- for (i=0; i < $slides.length; i++)
1019
- opts.els.push($slides[i]);
1020
-
1021
- for (i=0; i < opts.currSlide; i++)
1022
- opts.els.push(opts.els.shift());
1023
-
1024
- // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1025
- opts.fxFn = function(curr, next, opts, cb, fwd) {
1026
- var $el = fwd ? $(curr) : $(next);
1027
- $(next).css(opts.cssBefore);
1028
- var count = opts.slideCount;
1029
- $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1030
- var hops = $.fn.cycle.hopsFromLast(opts, fwd);
1031
- for (var k=0; k < hops; k++)
1032
- fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop());
1033
- if (fwd) {
1034
- for (var i=0, len=opts.els.length; i < len; i++)
1035
- $(opts.els[i]).css('z-index', len-i+count);
1036
- }
1037
- else {
1038
- var z = $(curr).css('z-index');
1039
- $el.css('z-index', parseInt(z)+1+count);
1040
- }
1041
- $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1042
- $(fwd ? this : curr).hide();
1043
- if (cb) cb();
1044
- });
1045
- });
1046
- };
1047
- opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
1048
- };
1049
-
1050
- // turnUp/Down/Left/Right
1051
- $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
1052
- opts.before.push(function(curr, next, opts) {
1053
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1054
- opts.cssBefore.top = next.cycleH;
1055
- opts.animIn.height = next.cycleH;
1056
- });
1057
- opts.cssFirst = { top: 0 };
1058
- opts.cssBefore = { left: 0, height: 0 };
1059
- opts.animIn = { top: 0 };
1060
- opts.animOut = { height: 0 };
1061
- };
1062
- $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
1063
- opts.before.push(function(curr, next, opts) {
1064
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1065
- opts.animIn.height = next.cycleH;
1066
- opts.animOut.top = curr.cycleH;
1067
- });
1068
- opts.cssFirst = { top: 0 };
1069
- opts.cssBefore = { left: 0, top: 0, height: 0 };
1070
- opts.animOut = { height: 0 };
1071
- };
1072
- $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
1073
- opts.before.push(function(curr, next, opts) {
1074
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1075
- opts.cssBefore.left = next.cycleW;
1076
- opts.animIn.width = next.cycleW;
1077
- });
1078
- opts.cssBefore = { top: 0, width: 0 };
1079
- opts.animIn = { left: 0 };
1080
- opts.animOut = { width: 0 };
1081
- };
1082
- $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
1083
- opts.before.push(function(curr, next, opts) {
1084
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1085
- opts.animIn.width = next.cycleW;
1086
- opts.animOut.left = curr.cycleW;
1087
- });
1088
- opts.cssBefore = { top: 0, left: 0, width: 0 };
1089
- opts.animIn = { left: 0 };
1090
- opts.animOut = { width: 0 };
1091
- };
1092
-
1093
- // zoom
1094
- $.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
1095
- opts.before.push(function(curr, next, opts) {
1096
- $.fn.cycle.commonReset(curr,next,opts,false,false,true);
1097
- opts.cssBefore.top = next.cycleH/2;
1098
- opts.cssBefore.left = next.cycleW/2;
1099
- opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
1100
- opts.animOut = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 };
1101
- });
1102
- opts.cssFirst = { top:0, left: 0 };
1103
- opts.cssBefore = { width: 0, height: 0 };
1104
- };
1105
-
1106
- // fadeZoom
1107
- $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
1108
- opts.before.push(function(curr, next, opts) {
1109
- $.fn.cycle.commonReset(curr,next,opts,false,false);
1110
- opts.cssBefore.left = next.cycleW/2;
1111
- opts.cssBefore.top = next.cycleH/2;
1112
- opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
1113
- });
1114
- opts.cssBefore = { width: 0, height: 0 };
1115
- opts.animOut = { opacity: 0 };
1116
- };
1117
-
1118
- // blindX
1119
- $.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
1120
- var w = $cont.css('overflow','hidden').width();
1121
- opts.before.push(function(curr, next, opts) {
1122
- $.fn.cycle.commonReset(curr,next,opts);
1123
- opts.animIn.width = next.cycleW;
1124
- opts.animOut.left = curr.cycleW;
1125
- });
1126
- opts.cssBefore = { left: w, top: 0 };
1127
- opts.animIn = { left: 0 };
1128
- opts.animOut = { left: w };
1129
- };
1130
- // blindY
1131
- $.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
1132
- var h = $cont.css('overflow','hidden').height();
1133
- opts.before.push(function(curr, next, opts) {
1134
- $.fn.cycle.commonReset(curr,next,opts);
1135
- opts.animIn.height = next.cycleH;
1136
- opts.animOut.top = curr.cycleH;
1137
- });
1138
- opts.cssBefore = { top: h, left: 0 };
1139
- opts.animIn = { top: 0 };
1140
- opts.animOut = { top: h };
1141
- };
1142
- // blindZ
1143
- $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
1144
- var h = $cont.css('overflow','hidden').height();
1145
- var w = $cont.width();
1146
- opts.before.push(function(curr, next, opts) {
1147
- $.fn.cycle.commonReset(curr,next,opts);
1148
- opts.animIn.height = next.cycleH;
1149
- opts.animOut.top = curr.cycleH;
1150
- });
1151
- opts.cssBefore = { top: h, left: w };
1152
- opts.animIn = { top: 0, left: 0 };
1153
- opts.animOut = { top: h, left: w };
1154
- };
1155
-
1156
- // growX - grow horizontally from centered 0 width
1157
- $.fn.cycle.transitions.growX = function($cont, $slides, opts) {
1158
- opts.before.push(function(curr, next, opts) {
1159
- $.fn.cycle.commonReset(curr,next,opts,false,true);
1160
- opts.cssBefore.left = this.cycleW/2;
1161
- opts.animIn = { left: 0, width: this.cycleW };
1162
- opts.animOut = { left: 0 };
1163
- });
1164
- opts.cssBefore = { width: 0, top: 0 };
1165
- };
1166
- // growY - grow vertically from centered 0 height
1167
- $.fn.cycle.transitions.growY = function($cont, $slides, opts) {
1168
- opts.before.push(function(curr, next, opts) {
1169
- $.fn.cycle.commonReset(curr,next,opts,true,false);
1170
- opts.cssBefore.top = this.cycleH/2;
1171
- opts.animIn = { top: 0, height: this.cycleH };
1172
- opts.animOut = { top: 0 };
1173
- });
1174
- opts.cssBefore = { height: 0, left: 0 };
1175
- };
1176
-
1177
- // curtainX - squeeze in both edges horizontally
1178
- $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
1179
- opts.before.push(function(curr, next, opts) {
1180
- $.fn.cycle.commonReset(curr,next,opts,false,true,true);
1181
- opts.cssBefore.left = next.cycleW/2;
1182
- opts.animIn = { left: 0, width: this.cycleW };
1183
- opts.animOut = { left: curr.cycleW/2, width: 0 };
1184
- });
1185
- opts.cssBefore = { top: 0, width: 0 };
1186
- };
1187
- // curtainY - squeeze in both edges vertically
1188
- $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
1189
- opts.before.push(function(curr, next, opts) {
1190
- $.fn.cycle.commonReset(curr,next,opts,true,false,true);
1191
- opts.cssBefore.top = next.cycleH/2;
1192
- opts.animIn = { top: 0, height: next.cycleH };
1193
- opts.animOut = { top: curr.cycleH/2, height: 0 };
1194
- });
1195
- opts.cssBefore = { left: 0, height: 0 };
1196
- };
1197
-
1198
- // cover - curr slide covered by next slide
1199
- $.fn.cycle.transitions.cover = function($cont, $slides, opts) {
1200
- var d = opts.direction || 'left';
1201
- var w = $cont.css('overflow','hidden').width();
1202
- var h = $cont.height();
1203
- opts.before.push(function(curr, next, opts) {
1204
- $.fn.cycle.commonReset(curr,next,opts);
1205
- if (d == 'right')
1206
- opts.cssBefore.left = -w;
1207
- else if (d == 'up')
1208
- opts.cssBefore.top = h;
1209
- else if (d == 'down')
1210
- opts.cssBefore.top = -h;
1211
- else
1212
- opts.cssBefore.left = w;
1213
- });
1214
- opts.animIn = { left: 0, top: 0};
1215
- opts.animOut = { opacity: 1 };
1216
- opts.cssBefore = { top: 0, left: 0 };
1217
- };
1218
-
1219
- // uncover - curr slide moves off next slide
1220
- $.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
1221
- var d = opts.direction || 'left';
1222
- var w = $cont.css('overflow','hidden').width();
1223
- var h = $cont.height();
1224
- opts.before.push(function(curr, next, opts) {
1225
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1226
- if (d == 'right')
1227
- opts.animOut.left = w;
1228
- else if (d == 'up')
1229
- opts.animOut.top = -h;
1230
- else if (d == 'down')
1231
- opts.animOut.top = h;
1232
- else
1233
- opts.animOut.left = -w;
1234
- });
1235
- opts.animIn = { left: 0, top: 0 };
1236
- opts.animOut = { opacity: 1 };
1237
- opts.cssBefore = { top: 0, left: 0 };
1238
- };
1239
-
1240
- // toss - move top slide and fade away
1241
- $.fn.cycle.transitions.toss = function($cont, $slides, opts) {
1242
- var w = $cont.css('overflow','visible').width();
1243
- var h = $cont.height();
1244
- opts.before.push(function(curr, next, opts) {
1245
- $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1246
- // provide default toss settings if animOut not provided
1247
- if (!opts.animOut.left && !opts.animOut.top)
1248
- opts.animOut = { left: w*2, top: -h/2, opacity: 0 };
1249
- else
1250
- opts.animOut.opacity = 0;
1251
- });
1252
- opts.cssBefore = { left: 0, top: 0 };
1253
- opts.animIn = { left: 0 };
1254
- };
1255
-
1256
- // wipe - clip animation
1257
- $.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
1258
- var w = $cont.css('overflow','hidden').width();
1259
- var h = $cont.height();
1260
- opts.cssBefore = opts.cssBefore || {};
1261
- var clip;
1262
- if (opts.clip) {
1263
- if (/l2r/.test(opts.clip))
1264
- clip = 'rect(0px 0px '+h+'px 0px)';
1265
- else if (/r2l/.test(opts.clip))
1266
- clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
1267
- else if (/t2b/.test(opts.clip))
1268
- clip = 'rect(0px '+w+'px 0px 0px)';
1269
- else if (/b2t/.test(opts.clip))
1270
- clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
1271
- else if (/zoom/.test(opts.clip)) {
1272
- var top = parseInt(h/2);
1273
- var left = parseInt(w/2);
1274
- clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
1275
- }
1276
- }
1277
-
1278
- opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
1279
-
1280
- var d = opts.cssBefore.clip.match(/(\d+)/g);
1281
- var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]);
1282
-
1283
- opts.before.push(function(curr, next, opts) {
1284
- if (curr == next) return;
1285
- var $curr = $(curr), $next = $(next);
1286
- $.fn.cycle.commonReset(curr,next,opts,true,true,false);
1287
- opts.cssAfter.display = 'block';
1288
-
1289
- var step = 1, count = parseInt((opts.speedIn / 13)) - 1;
1290
- (function f() {
1291
- var tt = t ? t - parseInt(step * (t/count)) : 0;
1292
- var ll = l ? l - parseInt(step * (l/count)) : 0;
1293
- var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h;
1294
- var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w;
1295
- $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
1296
- (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
1297
- })();
1298
- });
1299
- opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
1300
- opts.animIn = { left: 0 };
1301
- opts.animOut = { left: 0 };
1302
- };
1303
-
1304
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cycle Plugin (with Transition Definitions)
3
+ * Examples and documentation at: http://jquery.malsup.com/cycle/
4
+ * Copyright (c) 2007-2010 M. Alsup
5
+ * Version: 2.88 (08-JUN-2010)
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://jquery.malsup.com/license.html
8
+ * Requires: jQuery v1.2.6 or later
9
+ */
10
+ ;(function($) {
11
+
12
+ var ver = '2.88';
13
+
14
+ // if $.support is not defined (pre jQuery 1.3) add what I need
15
+ if ($.support == undefined) {
16
+ $.support = {
17
+ opacity: !($.browser.msie)
18
+ };
19
+ }
20
+
21
+ function debug(s) {
22
+ if ($.fn.cycle.debug)
23
+ log(s);
24
+ }
25
+ function log() {
26
+ if (window.console && window.console.log)
27
+ window.console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
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.cycle = 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).cycle(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.cycle.updateActivePagerLink;
64
+
65
+ // stop existing slideshow for this container (if there is one)
66
+ if (this.cycleTimeout)
67
+ clearTimeout(this.cycleTimeout);
68
+ this.cycleTimeout = this.cyclePause = 0;
69
+
70
+ var $cont = $(this);
71
+ var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
72
+ var els = $slides.get();
73
+ if (els.length < 2) {
74
+ log('terminating; too few slides: ' + els.length);
75
+ return;
76
+ }
77
+
78
+ var opts2 = buildOptions($cont, $slides, els, opts, o);
79
+ if (opts2 === false)
80
+ return;
81
+
82
+ var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.rev);
83
+
84
+ // if it's an auto slideshow, kick it off
85
+ if (startTime) {
86
+ startTime += (opts2.delay || 0);
87
+ if (startTime < 10)
88
+ startTime = 10;
89
+ debug('first timeout: ' + startTime);
90
+ this.cycleTimeout = setTimeout(function(){go(els,opts2,0,(!opts2.rev && !opts.backwards))}, startTime);
91
+ }
92
+ });
93
+ };
94
+
95
+ // process the args that were passed to the plugin fn
96
+ function handleArguments(cont, options, arg2) {
97
+ if (cont.cycleStop == undefined)
98
+ cont.cycleStop = 0;
99
+ if (options === undefined || options === null)
100
+ options = {};
101
+ if (options.constructor == String) {
102
+ switch(options) {
103
+ case 'destroy':
104
+ case 'stop':
105
+ var opts = $(cont).data('cycle.opts');
106
+ if (!opts)
107
+ return false;
108
+ cont.cycleStop++; // callbacks look for change
109
+ if (cont.cycleTimeout)
110
+ clearTimeout(cont.cycleTimeout);
111
+ cont.cycleTimeout = 0;
112
+ $(cont).removeData('cycle.opts');
113
+ if (options == 'destroy')
114
+ destroy(opts);
115
+ return false;
116
+ case 'toggle':
117
+ cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
118
+ checkInstantResume(cont.cyclePause, arg2, cont);
119
+ return false;
120
+ case 'pause':
121
+ cont.cyclePause = 1;
122
+ return false;
123
+ case 'resume':
124
+ cont.cyclePause = 0;
125
+ checkInstantResume(false, arg2, cont);
126
+ return false;
127
+ case 'prev':
128
+ case 'next':
129
+ var opts = $(cont).data('cycle.opts');
130
+ if (!opts) {
131
+ log('options not found, "prev/next" ignored');
132
+ return false;
133
+ }
134
+ $.fn.cycle[options](opts);
135
+ return false;
136
+ default:
137
+ options = { fx: options };
138
+ };
139
+ return options;
140
+ }
141
+ else if (options.constructor == Number) {
142
+ // go to the requested slide
143
+ var num = options;
144
+ options = $(cont).data('cycle.opts');
145
+ if (!options) {
146
+ log('options not found, can not advance slide');
147
+ return false;
148
+ }
149
+ if (num < 0 || num >= options.elements.length) {
150
+ log('invalid slide index: ' + num);
151
+ return false;
152
+ }
153
+ options.nextSlide = num;
154
+ if (cont.cycleTimeout) {
155
+ clearTimeout(cont.cycleTimeout);
156
+ cont.cycleTimeout = 0;
157
+ }
158
+ if (typeof arg2 == 'string')
159
+ options.oneTimeFx = arg2;
160
+ go(options.elements, options, 1, num >= options.currSlide);
161
+ return false;
162
+ }
163
+ return options;
164
+
165
+ function checkInstantResume(isPaused, arg2, cont) {
166
+ if (!isPaused && arg2 === true) { // resume now!
167
+ var options = $(cont).data('cycle.opts');
168
+ if (!options) {
169
+ log('options not found, can not resume');
170
+ return false;
171
+ }
172
+ if (cont.cycleTimeout) {
173
+ clearTimeout(cont.cycleTimeout);
174
+ cont.cycleTimeout = 0;
175
+ }
176
+ go(options.elements, options, 1, (!opts.rev && !opts.backwards));
177
+ }
178
+ }
179
+ };
180
+
181
+ function removeFilter(el, opts) {
182
+ if (!$.support.opacity && opts.cleartype && el.style.filter) {
183
+ try { el.style.removeAttribute('filter'); }
184
+ catch(smother) {} // handle old opera versions
185
+ }
186
+ };
187
+
188
+ // unbind event handlers
189
+ function destroy(opts) {
190
+ if (opts.next)
191
+ $(opts.next).unbind(opts.prevNextEvent);
192
+ if (opts.prev)
193
+ $(opts.prev).unbind(opts.prevNextEvent);
194
+
195
+ if (opts.pager || opts.pagerAnchorBuilder)
196
+ $.each(opts.pagerAnchors || [], function() {
197
+ this.unbind().remove();
198
+ });
199
+ opts.pagerAnchors = null;
200
+ if (opts.destroy) // callback
201
+ opts.destroy(opts);
202
+ };
203
+
204
+ // one-time initialization
205
+ function buildOptions($cont, $slides, els, options, o) {
206
+ // support metadata plugin (v1.0 and v2.0)
207
+ var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
208
+ if (opts.autostop)
209
+ opts.countdown = opts.autostopCount || els.length;
210
+
211
+ var cont = $cont[0];
212
+ $cont.data('cycle.opts', opts);
213
+ opts.$cont = $cont;
214
+ opts.stopCount = cont.cycleStop;
215
+ opts.elements = els;
216
+ opts.before = opts.before ? [opts.before] : [];
217
+ opts.after = opts.after ? [opts.after] : [];
218
+ opts.after.unshift(function(){ opts.busy=0; });
219
+
220
+ // push some after callbacks
221
+ if (!$.support.opacity && opts.cleartype)
222
+ opts.after.push(function() { removeFilter(this, opts); });
223
+ if (opts.continuous)
224
+ opts.after.push(function() { go(els,opts,0,(!opts.rev && !opts.backwards)); });
225
+
226
+ saveOriginalOpts(opts);
227
+
228
+ // clearType corrections
229
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
230
+ clearTypeFix($slides);
231
+
232
+ // container requires non-static position so that slides can be position within
233
+ if ($cont.css('position') == 'static')
234
+ $cont.css('position', 'relative');
235
+ if (opts.width)
236
+ $cont.width(opts.width);
237
+ if (opts.height && opts.height != 'auto')
238
+ $cont.height(opts.height);
239
+
240
+ if (opts.startingSlide)
241
+ opts.startingSlide = parseInt(opts.startingSlide);
242
+ else if (opts.backwards)
243
+ opts.startingSlide = els.length - 1;
244
+
245
+ // if random, mix up the slide array
246
+ if (opts.random) {
247
+ opts.randomMap = [];
248
+ for (var i = 0; i < els.length; i++)
249
+ opts.randomMap.push(i);
250
+ opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
251
+ opts.randomIndex = 1;
252
+ opts.startingSlide = opts.randomMap[1];
253
+ }
254
+ else if (opts.startingSlide >= els.length)
255
+ opts.startingSlide = 0; // catch bogus input
256
+ opts.currSlide = opts.startingSlide || 0;
257
+ var first = opts.startingSlide;
258
+
259
+ // set position and zIndex on all the slides
260
+ $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
261
+ var z;
262
+ if (opts.backwards)
263
+ z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
264
+ else
265
+ z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
266
+ $(this).css('z-index', z)
267
+ });
268
+
269
+ // make sure first slide is visible
270
+ $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
271
+ removeFilter(els[first], opts);
272
+
273
+ // stretch slides
274
+ if (opts.fit && opts.width)
275
+ $slides.width(opts.width);
276
+ if (opts.fit && opts.height && opts.height != 'auto')
277
+ $slides.height(opts.height);
278
+
279
+ // stretch container
280
+ var reshape = opts.containerResize && !$cont.innerHeight();
281
+ if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
282
+ var maxw = 0, maxh = 0;
283
+ for(var j=0; j < els.length; j++) {
284
+ var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
285
+ if (!w) w = e.offsetWidth || e.width || $e.attr('width')
286
+ if (!h) h = e.offsetHeight || e.height || $e.attr('height');
287
+ maxw = w > maxw ? w : maxw;
288
+ maxh = h > maxh ? h : maxh;
289
+ }
290
+ if (maxw > 0 && maxh > 0)
291
+ $cont.css({width:maxw+'px',height:maxh+'px'});
292
+ }
293
+
294
+ if (opts.pause)
295
+ $cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});
296
+
297
+ if (supportMultiTransitions(opts) === false)
298
+ return false;
299
+
300
+ // apparently a lot of people use image slideshows without height/width attributes on the images.
301
+ // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
302
+ var requeue = false;
303
+ options.requeueAttempts = options.requeueAttempts || 0;
304
+ $slides.each(function() {
305
+ // try to get height/width of each slide
306
+ var $el = $(this);
307
+ this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
308
+ this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
309
+
310
+ if ( $el.is('img') ) {
311
+ // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when
312
+ // an image is being downloaded and the markup did not include sizing info (height/width attributes);
313
+ // there seems to be some "default" sizes used in this situation
314
+ var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
315
+ var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete);
316
+ var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
317
+ var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);
318
+ // don't requeue for images that are still loading but have a valid size
319
+ if (loadingIE || loadingFF || loadingOp || loadingOther) {
320
+ if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
321
+ log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
322
+ setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout);
323
+ requeue = true;
324
+ return false; // break each loop
325
+ }
326
+ else {
327
+ log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
328
+ }
329
+ }
330
+ }
331
+ return true;
332
+ });
333
+
334
+ if (requeue)
335
+ return false;
336
+
337
+ opts.cssBefore = opts.cssBefore || {};
338
+ opts.animIn = opts.animIn || {};
339
+ opts.animOut = opts.animOut || {};
340
+
341
+ $slides.not(':eq('+first+')').css(opts.cssBefore);
342
+ if (opts.cssFirst)
343
+ $($slides[first]).css(opts.cssFirst);
344
+
345
+ if (opts.timeout) {
346
+ opts.timeout = parseInt(opts.timeout);
347
+ // ensure that timeout and speed settings are sane
348
+ if (opts.speed.constructor == String)
349
+ opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed);
350
+ if (!opts.sync)
351
+ opts.speed = opts.speed / 2;
352
+
353
+ var buffer = opts.fx == 'shuffle' ? 500 : 250;
354
+ while((opts.timeout - opts.speed) < buffer) // sanitize timeout
355
+ opts.timeout += opts.speed;
356
+ }
357
+ if (opts.easing)
358
+ opts.easeIn = opts.easeOut = opts.easing;
359
+ if (!opts.speedIn)
360
+ opts.speedIn = opts.speed;
361
+ if (!opts.speedOut)
362
+ opts.speedOut = opts.speed;
363
+
364
+ opts.slideCount = els.length;
365
+ opts.currSlide = opts.lastSlide = first;
366
+ if (opts.random) {
367
+ if (++opts.randomIndex == els.length)
368
+ opts.randomIndex = 0;
369
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
370
+ }
371
+ else if (opts.backwards)
372
+ opts.nextSlide = opts.startingSlide == 0 ? (els.length-1) : opts.startingSlide-1;
373
+ else
374
+ opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
375
+
376
+ // run transition init fn
377
+ if (!opts.multiFx) {
378
+ var init = $.fn.cycle.transitions[opts.fx];
379
+ if ($.isFunction(init))
380
+ init($cont, $slides, opts);
381
+ else if (opts.fx != 'custom' && !opts.multiFx) {
382
+ log('unknown transition: ' + opts.fx,'; slideshow terminating');
383
+ return false;
384
+ }
385
+ }
386
+
387
+ // fire artificial events
388
+ var e0 = $slides[first];
389
+ if (opts.before.length)
390
+ opts.before[0].apply(e0, [e0, e0, opts, true]);
391
+ if (opts.after.length > 1)
392
+ opts.after[1].apply(e0, [e0, e0, opts, true]);
393
+
394
+ if (opts.next)
395
+ $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1)});
396
+ if (opts.prev)
397
+ $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1)});
398
+ if (opts.pager || opts.pagerAnchorBuilder)
399
+ buildPager(els,opts);
400
+
401
+ exposeAddSlide(opts, els);
402
+
403
+ return opts;
404
+ };
405
+
406
+ // save off original opts so we can restore after clearing state
407
+ function saveOriginalOpts(opts) {
408
+ opts.original = { before: [], after: [] };
409
+ opts.original.cssBefore = $.extend({}, opts.cssBefore);
410
+ opts.original.cssAfter = $.extend({}, opts.cssAfter);
411
+ opts.original.animIn = $.extend({}, opts.animIn);
412
+ opts.original.animOut = $.extend({}, opts.animOut);
413
+ $.each(opts.before, function() { opts.original.before.push(this); });
414
+ $.each(opts.after, function() { opts.original.after.push(this); });
415
+ };
416
+
417
+ function supportMultiTransitions(opts) {
418
+ var i, tx, txs = $.fn.cycle.transitions;
419
+ // look for multiple effects
420
+ if (opts.fx.indexOf(',') > 0) {
421
+ opts.multiFx = true;
422
+ opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
423
+ // discard any bogus effect names
424
+ for (i=0; i < opts.fxs.length; i++) {
425
+ var fx = opts.fxs[i];
426
+ tx = txs[fx];
427
+ if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
428
+ log('discarding unknown transition: ',fx);
429
+ opts.fxs.splice(i,1);
430
+ i--;
431
+ }
432
+ }
433
+ // if we have an empty list then we threw everything away!
434
+ if (!opts.fxs.length) {
435
+ log('No valid transitions named; slideshow terminating.');
436
+ return false;
437
+ }
438
+ }
439
+ else if (opts.fx == 'all') { // auto-gen the list of transitions
440
+ opts.multiFx = true;
441
+ opts.fxs = [];
442
+ for (p in txs) {
443
+ tx = txs[p];
444
+ if (txs.hasOwnProperty(p) && $.isFunction(tx))
445
+ opts.fxs.push(p);
446
+ }
447
+ }
448
+ if (opts.multiFx && opts.randomizeEffects) {
449
+ // munge the fxs array to make effect selection random
450
+ var r1 = Math.floor(Math.random() * 20) + 30;
451
+ for (i = 0; i < r1; i++) {
452
+ var r2 = Math.floor(Math.random() * opts.fxs.length);
453
+ opts.fxs.push(opts.fxs.splice(r2,1)[0]);
454
+ }
455
+ debug('randomized fx sequence: ',opts.fxs);
456
+ }
457
+ return true;
458
+ };
459
+
460
+ // provide a mechanism for adding slides after the slideshow has started
461
+ function exposeAddSlide(opts, els) {
462
+ opts.addSlide = function(newSlide, prepend) {
463
+ var $s = $(newSlide), s = $s[0];
464
+ if (!opts.autostopCount)
465
+ opts.countdown++;
466
+ els[prepend?'unshift':'push'](s);
467
+ if (opts.els)
468
+ opts.els[prepend?'unshift':'push'](s); // shuffle needs this
469
+ opts.slideCount = els.length;
470
+
471
+ $s.css('position','absolute');
472
+ $s[prepend?'prependTo':'appendTo'](opts.$cont);
473
+
474
+ if (prepend) {
475
+ opts.currSlide++;
476
+ opts.nextSlide++;
477
+ }
478
+
479
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
480
+ clearTypeFix($s);
481
+
482
+ if (opts.fit && opts.width)
483
+ $s.width(opts.width);
484
+ if (opts.fit && opts.height && opts.height != 'auto')
485
+ $slides.height(opts.height);
486
+ s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
487
+ s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
488
+
489
+ $s.css(opts.cssBefore);
490
+
491
+ if (opts.pager || opts.pagerAnchorBuilder)
492
+ $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
493
+
494
+ if ($.isFunction(opts.onAddSlide))
495
+ opts.onAddSlide($s);
496
+ else
497
+ $s.hide(); // default behavior
498
+ };
499
+ }
500
+
501
+ // reset internal state; we do this on every pass in order to support multiple effects
502
+ $.fn.cycle.resetState = function(opts, fx) {
503
+ fx = fx || opts.fx;
504
+ opts.before = []; opts.after = [];
505
+ opts.cssBefore = $.extend({}, opts.original.cssBefore);
506
+ opts.cssAfter = $.extend({}, opts.original.cssAfter);
507
+ opts.animIn = $.extend({}, opts.original.animIn);
508
+ opts.animOut = $.extend({}, opts.original.animOut);
509
+ opts.fxFn = null;
510
+ $.each(opts.original.before, function() { opts.before.push(this); });
511
+ $.each(opts.original.after, function() { opts.after.push(this); });
512
+
513
+ // re-init
514
+ var init = $.fn.cycle.transitions[fx];
515
+ if ($.isFunction(init))
516
+ init(opts.$cont, $(opts.elements), opts);
517
+ };
518
+
519
+ // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
520
+ function go(els, opts, manual, fwd) {
521
+ // opts.busy is true if we're in the middle of an animation
522
+ if (manual && opts.busy && opts.manualTrump) {
523
+ // let manual transitions requests trump active ones
524
+ debug('manualTrump in go(), stopping active transition');
525
+ $(els).stop(true,true);
526
+ opts.busy = false;
527
+ }
528
+ // don't begin another timeout-based transition if there is one active
529
+ if (opts.busy) {
530
+ debug('transition active, ignoring new tx request');
531
+ return;
532
+ }
533
+
534
+ var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
535
+
536
+ // stop cycling if we have an outstanding stop request
537
+ if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
538
+ return;
539
+
540
+ // check to see if we should stop cycling based on autostop options
541
+ if (!manual && !p.cyclePause && !opts.bounce &&
542
+ ((opts.autostop && (--opts.countdown <= 0)) ||
543
+ (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
544
+ if (opts.end)
545
+ opts.end(opts);
546
+ return;
547
+ }
548
+
549
+ // if slideshow is paused, only transition on a manual trigger
550
+ var changed = false;
551
+ if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
552
+ changed = true;
553
+ var fx = opts.fx;
554
+ // keep trying to get the slide size if we don't have it yet
555
+ curr.cycleH = curr.cycleH || $(curr).height();
556
+ curr.cycleW = curr.cycleW || $(curr).width();
557
+ next.cycleH = next.cycleH || $(next).height();
558
+ next.cycleW = next.cycleW || $(next).width();
559
+
560
+ // support multiple transition types
561
+ if (opts.multiFx) {
562
+ if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length)
563
+ opts.lastFx = 0;
564
+ fx = opts.fxs[opts.lastFx];
565
+ opts.currFx = fx;
566
+ }
567
+
568
+ // one-time fx overrides apply to: $('div').cycle(3,'zoom');
569
+ if (opts.oneTimeFx) {
570
+ fx = opts.oneTimeFx;
571
+ opts.oneTimeFx = null;
572
+ }
573
+
574
+ $.fn.cycle.resetState(opts, fx);
575
+
576
+ // run the before callbacks
577
+ if (opts.before.length)
578
+ $.each(opts.before, function(i,o) {
579
+ if (p.cycleStop != opts.stopCount) return;
580
+ o.apply(next, [curr, next, opts, fwd]);
581
+ });
582
+
583
+ // stage the after callacks
584
+ var after = function() {
585
+ $.each(opts.after, function(i,o) {
586
+ if (p.cycleStop != opts.stopCount) return;
587
+ o.apply(next, [curr, next, opts, fwd]);
588
+ });
589
+ };
590
+
591
+ debug('tx firing; currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
592
+
593
+ // get ready to perform the transition
594
+ opts.busy = 1;
595
+ if (opts.fxFn) // fx function provided?
596
+ opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
597
+ else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
598
+ $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
599
+ else
600
+ $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
601
+ }
602
+
603
+ if (changed || opts.nextSlide == opts.currSlide) {
604
+ // calculate the next slide
605
+ opts.lastSlide = opts.currSlide;
606
+ if (opts.random) {
607
+ opts.currSlide = opts.nextSlide;
608
+ if (++opts.randomIndex == els.length)
609
+ opts.randomIndex = 0;
610
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
611
+ if (opts.nextSlide == opts.currSlide)
612
+ opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
613
+ }
614
+ else if (opts.backwards) {
615
+ var roll = (opts.nextSlide - 1) < 0;
616
+ if (roll && opts.bounce) {
617
+ opts.backwards = !opts.backwards;
618
+ opts.nextSlide = 1;
619
+ opts.currSlide = 0;
620
+ }
621
+ else {
622
+ opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
623
+ opts.currSlide = roll ? 0 : opts.nextSlide+1;
624
+ }
625
+ }
626
+ else { // sequence
627
+ var roll = (opts.nextSlide + 1) == els.length;
628
+ if (roll && opts.bounce) {
629
+ opts.backwards = !opts.backwards;
630
+ opts.nextSlide = els.length-2;
631
+ opts.currSlide = els.length-1;
632
+ }
633
+ else {
634
+ opts.nextSlide = roll ? 0 : opts.nextSlide+1;
635
+ opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
636
+ }
637
+ }
638
+ }
639
+ if (changed && opts.pager)
640
+ opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
641
+
642
+ // stage the next transition
643
+ var ms = 0;
644
+ if (opts.timeout && !opts.continuous)
645
+ ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
646
+ else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
647
+ ms = 10;
648
+ if (ms > 0)
649
+ p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, (!opts.rev && !opts.backwards)) }, ms);
650
+ };
651
+
652
+ // invoked after transition
653
+ $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
654
+ $(pager).each(function() {
655
+ $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
656
+ });
657
+ };
658
+
659
+ // calculate timeout value for current transition
660
+ function getTimeout(curr, next, opts, fwd) {
661
+ if (opts.timeoutFn) {
662
+ // call user provided calc fn
663
+ var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
664
+ while ((t - opts.speed) < 250) // sanitize timeout
665
+ t += opts.speed;
666
+ debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
667
+ if (t !== false)
668
+ return t;
669
+ }
670
+ return opts.timeout;
671
+ };
672
+
673
+ // expose next/prev function, caller must pass in state
674
+ $.fn.cycle.next = function(opts) { advance(opts, opts.rev?-1:1); };
675
+ $.fn.cycle.prev = function(opts) { advance(opts, opts.rev?1:-1);};
676
+
677
+ // advance slide forward or back
678
+ function advance(opts, val) {
679
+ var els = opts.elements;
680
+ var p = opts.$cont[0], timeout = p.cycleTimeout;
681
+ if (timeout) {
682
+ clearTimeout(timeout);
683
+ p.cycleTimeout = 0;
684
+ }
685
+ if (opts.random && val < 0) {
686
+ // move back to the previously display slide
687
+ opts.randomIndex--;
688
+ if (--opts.randomIndex == -2)
689
+ opts.randomIndex = els.length-2;
690
+ else if (opts.randomIndex == -1)
691
+ opts.randomIndex = els.length-1;
692
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
693
+ }
694
+ else if (opts.random) {
695
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
696
+ }
697
+ else {
698
+ opts.nextSlide = opts.currSlide + val;
699
+ if (opts.nextSlide < 0) {
700
+ if (opts.nowrap) return false;
701
+ opts.nextSlide = els.length - 1;
702
+ }
703
+ else if (opts.nextSlide >= els.length) {
704
+ if (opts.nowrap) return false;
705
+ opts.nextSlide = 0;
706
+ }
707
+ }
708
+
709
+ var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
710
+ if ($.isFunction(cb))
711
+ cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
712
+ go(els, opts, 1, val>=0);
713
+ return false;
714
+ };
715
+
716
+ function buildPager(els, opts) {
717
+ var $p = $(opts.pager);
718
+ $.each(els, function(i,o) {
719
+ $.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
720
+ });
721
+ opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
722
+ };
723
+
724
+ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
725
+ var a;
726
+ if ($.isFunction(opts.pagerAnchorBuilder)) {
727
+ a = opts.pagerAnchorBuilder(i,el);
728
+ debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
729
+ }
730
+ else
731
+ a = '<a href="#">'+(i+1)+'</a>';
732
+
733
+ if (!a)
734
+ return;
735
+ var $a = $(a);
736
+ // don't reparent if anchor is in the dom
737
+ if ($a.parents('body').length === 0) {
738
+ var arr = [];
739
+ if ($p.length > 1) {
740
+ $p.each(function() {
741
+ var $clone = $a.clone(true);
742
+ $(this).append($clone);
743
+ arr.push($clone[0]);
744
+ });
745
+ $a = $(arr);
746
+ }
747
+ else {
748
+ $a.appendTo($p);
749
+ }
750
+ }
751
+
752
+ opts.pagerAnchors = opts.pagerAnchors || [];
753
+ opts.pagerAnchors.push($a);
754
+ $a.bind(opts.pagerEvent, function(e) {
755
+ e.preventDefault();
756
+ opts.nextSlide = i;
757
+ var p = opts.$cont[0], timeout = p.cycleTimeout;
758
+ if (timeout) {
759
+ clearTimeout(timeout);
760
+ p.cycleTimeout = 0;
761
+ }
762
+ var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
763
+ if ($.isFunction(cb))
764
+ cb(opts.nextSlide, els[opts.nextSlide]);
765
+ go(els,opts,1,opts.currSlide < i); // trigger the trans
766
+ // return false; // <== allow bubble
767
+ });
768
+
769
+ if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
770
+ $a.bind('click.cycle', function(){return false;}); // suppress click
771
+
772
+ if (opts.pauseOnPagerHover)
773
+ $a.hover(function() { opts.$cont[0].cyclePause++; }, function() { opts.$cont[0].cyclePause--; } );
774
+ };
775
+
776
+ // helper fn to calculate the number of slides between the current and the next
777
+ $.fn.cycle.hopsFromLast = function(opts, fwd) {
778
+ var hops, l = opts.lastSlide, c = opts.currSlide;
779
+ if (fwd)
780
+ hops = c > l ? c - l : opts.slideCount - l;
781
+ else
782
+ hops = c < l ? l - c : l + opts.slideCount - c;
783
+ return hops;
784
+ };
785
+
786
+ // fix clearType problems in ie6 by setting an explicit bg color
787
+ // (otherwise text slides look horrible during a fade transition)
788
+ function clearTypeFix($slides) {
789
+ debug('applying clearType background-color hack');
790
+ function hex(s) {
791
+ s = parseInt(s).toString(16);
792
+ return s.length < 2 ? '0'+s : s;
793
+ };
794
+ function getBg(e) {
795
+ for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
796
+ var v = $.css(e,'background-color');
797
+ if (v.indexOf('rgb') >= 0 ) {
798
+ var rgb = v.match(/\d+/g);
799
+ return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
800
+ }
801
+ if (v && v != 'transparent')
802
+ return v;
803
+ }
804
+ return '#ffffff';
805
+ };
806
+ $slides.each(function() { $(this).css('background-color', getBg(this)); });
807
+ };
808
+
809
+ // reset common props before the next transition
810
+ $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
811
+ $(opts.elements).not(curr).hide();
812
+ opts.cssBefore.opacity = 1;
813
+ opts.cssBefore.display = 'block';
814
+ if (w !== false && next.cycleW > 0)
815
+ opts.cssBefore.width = next.cycleW;
816
+ if (h !== false && next.cycleH > 0)
817
+ opts.cssBefore.height = next.cycleH;
818
+ opts.cssAfter = opts.cssAfter || {};
819
+ opts.cssAfter.display = 'none';
820
+ $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
821
+ $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
822
+ };
823
+
824
+ // the actual fn for effecting a transition
825
+ $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
826
+ var $l = $(curr), $n = $(next);
827
+ var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
828
+ $n.css(opts.cssBefore);
829
+ if (speedOverride) {
830
+ if (typeof speedOverride == 'number')
831
+ speedIn = speedOut = speedOverride;
832
+ else
833
+ speedIn = speedOut = 1;
834
+ easeIn = easeOut = null;
835
+ }
836
+ var fn = function() {$n.animate(opts.animIn, speedIn, easeIn, cb)};
837
+ $l.animate(opts.animOut, speedOut, easeOut, function() {
838
+ if (opts.cssAfter) $l.css(opts.cssAfter);
839
+ if (!opts.sync) fn();
840
+ });
841
+ if (opts.sync) fn();
842
+ };
843
+
844
+ // transition definitions - only fade is defined here, transition pack defines the rest
845
+ $.fn.cycle.transitions = {
846
+ fade: function($cont, $slides, opts) {
847
+ $slides.not(':eq('+opts.currSlide+')').css('opacity',0);
848
+ opts.before.push(function(curr,next,opts) {
849
+ $.fn.cycle.commonReset(curr,next,opts);
850
+ opts.cssBefore.opacity = 0;
851
+ });
852
+ opts.animIn = { opacity: 1 };
853
+ opts.animOut = { opacity: 0 };
854
+ opts.cssBefore = { top: 0, left: 0 };
855
+ }
856
+ };
857
+
858
+ $.fn.cycle.ver = function() { return ver; };
859
+
860
+ // override these globally if you like (they are all optional)
861
+ $.fn.cycle.defaults = {
862
+ fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
863
+ timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
864
+ timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
865
+ continuous: 0, // true to start next transition immediately after current one completes
866
+ speed: 1000, // speed of the transition (any valid fx speed value)
867
+ speedIn: null, // speed of the 'in' transition
868
+ speedOut: null, // speed of the 'out' transition
869
+ next: null, // selector for element to use as event trigger for next slide
870
+ prev: null, // selector for element to use as event trigger for previous slide
871
+ // prevNextClick: null, // @deprecated; please use onPrevNextEvent instead
872
+ onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
873
+ prevNextEvent:'click.cycle',// event which drives the manual transition to the previous or next slide
874
+ pager: null, // selector for element to use as pager container
875
+ //pagerClick null, // @deprecated; please use onPagerEvent instead
876
+ onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
877
+ pagerEvent: 'click.cycle', // name of event which drives the pager navigation
878
+ allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
879
+ pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement)
880
+ before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
881
+ after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
882
+ end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
883
+ easing: null, // easing method for both in and out transitions
884
+ easeIn: null, // easing for "in" transition
885
+ easeOut: null, // easing for "out" transition
886
+ shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
887
+ animIn: null, // properties that define how the slide animates in
888
+ animOut: null, // properties that define how the slide animates out
889
+ cssBefore: null, // properties that define the initial state of the slide before transitioning in
890
+ cssAfter: null, // properties that defined the state of the slide after transitioning out
891
+ fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
892
+ height: 'auto', // container height
893
+ startingSlide: 0, // zero-based index of the first slide to be displayed
894
+ sync: 1, // true if in/out transitions should occur simultaneously
895
+ random: 0, // true for random, false for sequence (not applicable to shuffle fx)
896
+ fit: 0, // force slides to fit container
897
+ containerResize: 1, // resize container to fit largest slide
898
+ pause: 0, // true to enable "pause on hover"
899
+ pauseOnPagerHover: 0, // true to pause when hovering over pager link
900
+ autostop: 0, // true to end slideshow after X transitions (where X == slide count)
901
+ autostopCount: 0, // number of transitions (optionally used with autostop to define X)
902
+ delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
903
+ slideExpr: null, // expression for selecting slides (if something other than all children is required)
904
+ cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE)
905
+ cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
906
+ nowrap: 0, // true to prevent slideshow from wrapping
907
+ fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
908
+ randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random
909
+ rev: 0, // causes animations to transition in reverse
910
+ manualTrump: true, // causes manual transition to stop an active transition instead of being ignored
911
+ requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
912
+ requeueTimeout: 250, // ms delay for requeue
913
+ activePagerClass: 'activeSlide', // class name used for the active pager link
914
+ updateActivePagerLink: null, // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
915
+ backwards: false // true to start slideshow at last slide and move backwards through the stack
916
+ };
917
+
918
+ })(jQuery);
919
+
920
+
921
+ /*!
922
+ * jQuery Cycle Plugin Transition Definitions
923
+ * This script is a plugin for the jQuery Cycle Plugin
924
+ * Examples and documentation at: http://malsup.com/jquery/cycle/
925
+ * Copyright (c) 2007-2010 M. Alsup
926
+ * Version: 2.72
927
+ * Dual licensed under the MIT and GPL licenses:
928
+ * http://www.opensource.org/licenses/mit-license.php
929
+ * http://www.gnu.org/licenses/gpl.html
930
+ */
931
+ (function($) {
932
+
933
+ //
934
+ // These functions define one-time slide initialization for the named
935
+ // transitions. To save file size feel free to remove any of these that you
936
+ // don't need.
937
+ //
938
+ $.fn.cycle.transitions.none = function($cont, $slides, opts) {
939
+ opts.fxFn = function(curr,next,opts,after){
940
+ $(next).show();
941
+ $(curr).hide();
942
+ after();
943
+ };
944
+ }
945
+
946
+ // scrollUp/Down/Left/Right
947
+ $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
948
+ $cont.css('overflow','hidden');
949
+ opts.before.push($.fn.cycle.commonReset);
950
+ var h = $cont.height();
951
+ opts.cssBefore ={ top: h, left: 0 };
952
+ opts.cssFirst = { top: 0 };
953
+ opts.animIn = { top: 0 };
954
+ opts.animOut = { top: -h };
955
+ };
956
+ $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
957
+ $cont.css('overflow','hidden');
958
+ opts.before.push($.fn.cycle.commonReset);
959
+ var h = $cont.height();
960
+ opts.cssFirst = { top: 0 };
961
+ opts.cssBefore= { top: -h, left: 0 };
962
+ opts.animIn = { top: 0 };
963
+ opts.animOut = { top: h };
964
+ };
965
+ $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
966
+ $cont.css('overflow','hidden');
967
+ opts.before.push($.fn.cycle.commonReset);
968
+ var w = $cont.width();
969
+ opts.cssFirst = { left: 0 };
970
+ opts.cssBefore= { left: w, top: 0 };
971
+ opts.animIn = { left: 0 };
972
+ opts.animOut = { left: 0-w };
973
+ };
974
+ $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
975
+ $cont.css('overflow','hidden');
976
+ opts.before.push($.fn.cycle.commonReset);
977
+ var w = $cont.width();
978
+ opts.cssFirst = { left: 0 };
979
+ opts.cssBefore= { left: -w, top: 0 };
980
+ opts.animIn = { left: 0 };
981
+ opts.animOut = { left: w };
982
+ };
983
+ $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
984
+ $cont.css('overflow','hidden').width();
985
+ opts.before.push(function(curr, next, opts, fwd) {
986
+ $.fn.cycle.commonReset(curr,next,opts);
987
+ opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
988
+ opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
989
+ });
990
+ opts.cssFirst = { left: 0 };
991
+ opts.cssBefore= { top: 0 };
992
+ opts.animIn = { left: 0 };
993
+ opts.animOut = { top: 0 };
994
+ };
995
+ $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
996
+ $cont.css('overflow','hidden');
997
+ opts.before.push(function(curr, next, opts, fwd) {
998
+ $.fn.cycle.commonReset(curr,next,opts);
999
+ opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
1000
+ opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
1001
+ });
1002
+ opts.cssFirst = { top: 0 };
1003
+ opts.cssBefore= { left: 0 };
1004
+ opts.animIn = { top: 0 };
1005
+ opts.animOut = { left: 0 };
1006
+ };
1007
+
1008
+ // slideX/slideY
1009
+ $.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
1010
+ opts.before.push(function(curr, next, opts) {
1011
+ $(opts.elements).not(curr).hide();
1012
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1013
+ opts.animIn.width = next.cycleW;
1014
+ });
1015
+ opts.cssBefore = { left: 0, top: 0, width: 0 };
1016
+ opts.animIn = { width: 'show' };
1017
+ opts.animOut = { width: 0 };
1018
+ };
1019
+ $.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
1020
+ opts.before.push(function(curr, next, opts) {
1021
+ $(opts.elements).not(curr).hide();
1022
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1023
+ opts.animIn.height = next.cycleH;
1024
+ });
1025
+ opts.cssBefore = { left: 0, top: 0, height: 0 };
1026
+ opts.animIn = { height: 'show' };
1027
+ opts.animOut = { height: 0 };
1028
+ };
1029
+
1030
+ // shuffle
1031
+ $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
1032
+ var i, w = $cont.css('overflow', 'visible').width();
1033
+ $slides.css({left: 0, top: 0});
1034
+ opts.before.push(function(curr,next,opts) {
1035
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1036
+ });
1037
+ // only adjust speed once!
1038
+ if (!opts.speedAdjusted) {
1039
+ opts.speed = opts.speed / 2; // shuffle has 2 transitions
1040
+ opts.speedAdjusted = true;
1041
+ }
1042
+ opts.random = 0;
1043
+ opts.shuffle = opts.shuffle || {left:-w, top:15};
1044
+ opts.els = [];
1045
+ for (i=0; i < $slides.length; i++)
1046
+ opts.els.push($slides[i]);
1047
+
1048
+ for (i=0; i < opts.currSlide; i++)
1049
+ opts.els.push(opts.els.shift());
1050
+
1051
+ // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1052
+ opts.fxFn = function(curr, next, opts, cb, fwd) {
1053
+ var $el = fwd ? $(curr) : $(next);
1054
+ $(next).css(opts.cssBefore);
1055
+ var count = opts.slideCount;
1056
+ $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1057
+ var hops = $.fn.cycle.hopsFromLast(opts, fwd);
1058
+ for (var k=0; k < hops; k++)
1059
+ fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop());
1060
+ if (fwd) {
1061
+ for (var i=0, len=opts.els.length; i < len; i++)
1062
+ $(opts.els[i]).css('z-index', len-i+count);
1063
+ }
1064
+ else {
1065
+ var z = $(curr).css('z-index');
1066
+ $el.css('z-index', parseInt(z)+1+count);
1067
+ }
1068
+ $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1069
+ $(fwd ? this : curr).hide();
1070
+ if (cb) cb();
1071
+ });
1072
+ });
1073
+ };
1074
+ opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
1075
+ };
1076
+
1077
+ // turnUp/Down/Left/Right
1078
+ $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
1079
+ opts.before.push(function(curr, next, opts) {
1080
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1081
+ opts.cssBefore.top = next.cycleH;
1082
+ opts.animIn.height = next.cycleH;
1083
+ });
1084
+ opts.cssFirst = { top: 0 };
1085
+ opts.cssBefore = { left: 0, height: 0 };
1086
+ opts.animIn = { top: 0 };
1087
+ opts.animOut = { height: 0 };
1088
+ };
1089
+ $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
1090
+ opts.before.push(function(curr, next, opts) {
1091
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1092
+ opts.animIn.height = next.cycleH;
1093
+ opts.animOut.top = curr.cycleH;
1094
+ });
1095
+ opts.cssFirst = { top: 0 };
1096
+ opts.cssBefore = { left: 0, top: 0, height: 0 };
1097
+ opts.animOut = { height: 0 };
1098
+ };
1099
+ $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
1100
+ opts.before.push(function(curr, next, opts) {
1101
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1102
+ opts.cssBefore.left = next.cycleW;
1103
+ opts.animIn.width = next.cycleW;
1104
+ });
1105
+ opts.cssBefore = { top: 0, width: 0 };
1106
+ opts.animIn = { left: 0 };
1107
+ opts.animOut = { width: 0 };
1108
+ };
1109
+ $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
1110
+ opts.before.push(function(curr, next, opts) {
1111
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1112
+ opts.animIn.width = next.cycleW;
1113
+ opts.animOut.left = curr.cycleW;
1114
+ });
1115
+ opts.cssBefore = { top: 0, left: 0, width: 0 };
1116
+ opts.animIn = { left: 0 };
1117
+ opts.animOut = { width: 0 };
1118
+ };
1119
+
1120
+ // zoom
1121
+ $.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
1122
+ opts.before.push(function(curr, next, opts) {
1123
+ $.fn.cycle.commonReset(curr,next,opts,false,false,true);
1124
+ opts.cssBefore.top = next.cycleH/2;
1125
+ opts.cssBefore.left = next.cycleW/2;
1126
+ opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
1127
+ opts.animOut = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 };
1128
+ });
1129
+ opts.cssFirst = { top:0, left: 0 };
1130
+ opts.cssBefore = { width: 0, height: 0 };
1131
+ };
1132
+
1133
+ // fadeZoom
1134
+ $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
1135
+ opts.before.push(function(curr, next, opts) {
1136
+ $.fn.cycle.commonReset(curr,next,opts,false,false);
1137
+ opts.cssBefore.left = next.cycleW/2;
1138
+ opts.cssBefore.top = next.cycleH/2;
1139
+ opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
1140
+ });
1141
+ opts.cssBefore = { width: 0, height: 0 };
1142
+ opts.animOut = { opacity: 0 };
1143
+ };
1144
+
1145
+ // blindX
1146
+ $.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
1147
+ var w = $cont.css('overflow','hidden').width();
1148
+ opts.before.push(function(curr, next, opts) {
1149
+ $.fn.cycle.commonReset(curr,next,opts);
1150
+ opts.animIn.width = next.cycleW;
1151
+ opts.animOut.left = curr.cycleW;
1152
+ });
1153
+ opts.cssBefore = { left: w, top: 0 };
1154
+ opts.animIn = { left: 0 };
1155
+ opts.animOut = { left: w };
1156
+ };
1157
+ // blindY
1158
+ $.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
1159
+ var h = $cont.css('overflow','hidden').height();
1160
+ opts.before.push(function(curr, next, opts) {
1161
+ $.fn.cycle.commonReset(curr,next,opts);
1162
+ opts.animIn.height = next.cycleH;
1163
+ opts.animOut.top = curr.cycleH;
1164
+ });
1165
+ opts.cssBefore = { top: h, left: 0 };
1166
+ opts.animIn = { top: 0 };
1167
+ opts.animOut = { top: h };
1168
+ };
1169
+ // blindZ
1170
+ $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
1171
+ var h = $cont.css('overflow','hidden').height();
1172
+ var w = $cont.width();
1173
+ opts.before.push(function(curr, next, opts) {
1174
+ $.fn.cycle.commonReset(curr,next,opts);
1175
+ opts.animIn.height = next.cycleH;
1176
+ opts.animOut.top = curr.cycleH;
1177
+ });
1178
+ opts.cssBefore = { top: h, left: w };
1179
+ opts.animIn = { top: 0, left: 0 };
1180
+ opts.animOut = { top: h, left: w };
1181
+ };
1182
+
1183
+ // growX - grow horizontally from centered 0 width
1184
+ $.fn.cycle.transitions.growX = function($cont, $slides, opts) {
1185
+ opts.before.push(function(curr, next, opts) {
1186
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1187
+ opts.cssBefore.left = this.cycleW/2;
1188
+ opts.animIn = { left: 0, width: this.cycleW };
1189
+ opts.animOut = { left: 0 };
1190
+ });
1191
+ opts.cssBefore = { width: 0, top: 0 };
1192
+ };
1193
+ // growY - grow vertically from centered 0 height
1194
+ $.fn.cycle.transitions.growY = function($cont, $slides, opts) {
1195
+ opts.before.push(function(curr, next, opts) {
1196
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1197
+ opts.cssBefore.top = this.cycleH/2;
1198
+ opts.animIn = { top: 0, height: this.cycleH };
1199
+ opts.animOut = { top: 0 };
1200
+ });
1201
+ opts.cssBefore = { height: 0, left: 0 };
1202
+ };
1203
+
1204
+ // curtainX - squeeze in both edges horizontally
1205
+ $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
1206
+ opts.before.push(function(curr, next, opts) {
1207
+ $.fn.cycle.commonReset(curr,next,opts,false,true,true);
1208
+ opts.cssBefore.left = next.cycleW/2;
1209
+ opts.animIn = { left: 0, width: this.cycleW };
1210
+ opts.animOut = { left: curr.cycleW/2, width: 0 };
1211
+ });
1212
+ opts.cssBefore = { top: 0, width: 0 };
1213
+ };
1214
+ // curtainY - squeeze in both edges vertically
1215
+ $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
1216
+ opts.before.push(function(curr, next, opts) {
1217
+ $.fn.cycle.commonReset(curr,next,opts,true,false,true);
1218
+ opts.cssBefore.top = next.cycleH/2;
1219
+ opts.animIn = { top: 0, height: next.cycleH };
1220
+ opts.animOut = { top: curr.cycleH/2, height: 0 };
1221
+ });
1222
+ opts.cssBefore = { left: 0, height: 0 };
1223
+ };
1224
+
1225
+ // cover - curr slide covered by next slide
1226
+ $.fn.cycle.transitions.cover = function($cont, $slides, opts) {
1227
+ var d = opts.direction || 'left';
1228
+ var w = $cont.css('overflow','hidden').width();
1229
+ var h = $cont.height();
1230
+ opts.before.push(function(curr, next, opts) {
1231
+ $.fn.cycle.commonReset(curr,next,opts);
1232
+ if (d == 'right')
1233
+ opts.cssBefore.left = -w;
1234
+ else if (d == 'up')
1235
+ opts.cssBefore.top = h;
1236
+ else if (d == 'down')
1237
+ opts.cssBefore.top = -h;
1238
+ else
1239
+ opts.cssBefore.left = w;
1240
+ });
1241
+ opts.animIn = { left: 0, top: 0};
1242
+ opts.animOut = { opacity: 1 };
1243
+ opts.cssBefore = { top: 0, left: 0 };
1244
+ };
1245
+
1246
+ // uncover - curr slide moves off next slide
1247
+ $.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
1248
+ var d = opts.direction || 'left';
1249
+ var w = $cont.css('overflow','hidden').width();
1250
+ var h = $cont.height();
1251
+ opts.before.push(function(curr, next, opts) {
1252
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1253
+ if (d == 'right')
1254
+ opts.animOut.left = w;
1255
+ else if (d == 'up')
1256
+ opts.animOut.top = -h;
1257
+ else if (d == 'down')
1258
+ opts.animOut.top = h;
1259
+ else
1260
+ opts.animOut.left = -w;
1261
+ });
1262
+ opts.animIn = { left: 0, top: 0 };
1263
+ opts.animOut = { opacity: 1 };
1264
+ opts.cssBefore = { top: 0, left: 0 };
1265
+ };
1266
+
1267
+ // toss - move top slide and fade away
1268
+ $.fn.cycle.transitions.toss = function($cont, $slides, opts) {
1269
+ var w = $cont.css('overflow','visible').width();
1270
+ var h = $cont.height();
1271
+ opts.before.push(function(curr, next, opts) {
1272
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1273
+ // provide default toss settings if animOut not provided
1274
+ if (!opts.animOut.left && !opts.animOut.top)
1275
+ opts.animOut = { left: w*2, top: -h/2, opacity: 0 };
1276
+ else
1277
+ opts.animOut.opacity = 0;
1278
+ });
1279
+ opts.cssBefore = { left: 0, top: 0 };
1280
+ opts.animIn = { left: 0 };
1281
+ };
1282
+
1283
+ // wipe - clip animation
1284
+ $.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
1285
+ var w = $cont.css('overflow','hidden').width();
1286
+ var h = $cont.height();
1287
+ opts.cssBefore = opts.cssBefore || {};
1288
+ var clip;
1289
+ if (opts.clip) {
1290
+ if (/l2r/.test(opts.clip))
1291
+ clip = 'rect(0px 0px '+h+'px 0px)';
1292
+ else if (/r2l/.test(opts.clip))
1293
+ clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
1294
+ else if (/t2b/.test(opts.clip))
1295
+ clip = 'rect(0px '+w+'px 0px 0px)';
1296
+ else if (/b2t/.test(opts.clip))
1297
+ clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
1298
+ else if (/zoom/.test(opts.clip)) {
1299
+ var top = parseInt(h/2);
1300
+ var left = parseInt(w/2);
1301
+ clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
1302
+ }
1303
+ }
1304
+
1305
+ opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
1306
+
1307
+ var d = opts.cssBefore.clip.match(/(\d+)/g);
1308
+ var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]);
1309
+
1310
+ opts.before.push(function(curr, next, opts) {
1311
+ if (curr == next) return;
1312
+ var $curr = $(curr), $next = $(next);
1313
+ $.fn.cycle.commonReset(curr,next,opts,true,true,false);
1314
+ opts.cssAfter.display = 'block';
1315
+
1316
+ var step = 1, count = parseInt((opts.speedIn / 13)) - 1;
1317
+ (function f() {
1318
+ var tt = t ? t - parseInt(step * (t/count)) : 0;
1319
+ var ll = l ? l - parseInt(step * (l/count)) : 0;
1320
+ var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h;
1321
+ var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w;
1322
+ $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
1323
+ (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
1324
+ })();
1325
+ });
1326
+ opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
1327
+ opts.animIn = { left: 0 };
1328
+ opts.animOut = { left: 0 };
1329
+ };
1330
+
1331
+ })(jQuery);
js/slideshow.js CHANGED
@@ -9,7 +9,7 @@ var $slidetimeout = parseInt( meteorslidessettings.meteorslideshowduration );
9
  var $slidetransition = meteorslidessettings.meteorslideshowtransition;
10
 
11
  $j(document).ready(function() {
12
- $j('.meteor-slideshow').cycle({
13
  fx: $slidetransition,
14
  speed: $slidespeed,
15
  timeout: $slidetimeout,
9
  var $slidetransition = meteorslidessettings.meteorslideshowtransition;
10
 
11
  $j(document).ready(function() {
12
+ $j('#meteor-slideshow').cycle({
13
  fx: $slidetransition,
14
  speed: $slidespeed,
15
  timeout: $slidetimeout,
meteor-slides-plugin.php CHANGED
@@ -6,7 +6,7 @@
6
  Author: Josh Leuze
7
  Author URI: http://www.jleuze.com/
8
  License: GPL2
9
- Version: 1.0.2
10
  */
11
 
12
  /* Copyright 2010 Josh Leuze (email : mail@jleuze.com)
@@ -327,6 +327,32 @@
327
 
328
  }
329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  // Adds JavaScript for the slideshow
331
 
332
  add_action( 'wp_print_scripts', 'meteorslides_javascript' );
@@ -394,4 +420,39 @@
394
 
395
  */
396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  ?>
6
  Author: Josh Leuze
7
  Author URI: http://www.jleuze.com/
8
  License: GPL2
9
+ Version: 1.1
10
  */
11
 
12
  /* Copyright 2010 Josh Leuze (email : mail@jleuze.com)
327
 
328
  }
329
 
330
+ // Adds CSS for the slideshow
331
+
332
+ add_action('wp_head', 'meteorslides_css');
333
+
334
+ function meteorslides_css() {
335
+
336
+ if(file_exists(get_stylesheet_directory()."/meteor-slides.css")) {
337
+
338
+ echo "<link type='text/css' rel='stylesheet' href='" . get_stylesheet_directory_uri() . "/meteor-slides.css' />";
339
+
340
+ }
341
+
342
+ elseif(file_exists(get_template_directory()."/meteor-slides.css")) {
343
+
344
+ echo "<link type='text/css' rel='stylesheet' href='" . get_template_directory_uri() . "/meteor-slides.css' />";
345
+
346
+ }
347
+
348
+ else {
349
+
350
+ echo "<link type='text/css' rel='stylesheet' href='" . plugins_url('/css/meteor-slides.css', __FILE__) . "' />";
351
+
352
+ }
353
+
354
+ }
355
+
356
  // Adds JavaScript for the slideshow
357
 
358
  add_action( 'wp_print_scripts', 'meteorslides_javascript' );
420
 
421
  */
422
 
423
+ // Adds widget to load slideshow in sidebar
424
+
425
+ add_action( 'widgets_init', 'meteorslides_register_widget' );
426
+
427
+ function meteorslides_register_widget() {
428
+
429
+ register_widget( 'meteorslides_widget' );
430
+
431
+ }
432
+
433
+ class meteorslides_widget extends WP_Widget {
434
+
435
+ function meteorslides_widget() {
436
+
437
+ $widget_ops = array( 'classname' => 'meteor-slides-widget', 'description' => 'Add Meteor Slides slideshow to a sidebar' );
438
+
439
+ $control_ops = array( 'id_base' => 'meteor-slides-widget' );
440
+
441
+ $this->WP_Widget( 'meteor-slides-widget', 'Meteor Slides Widget', $widget_ops, $control_ops );
442
+ }
443
+
444
+ function widget( $args, $instance ) {
445
+
446
+ extract( $args );
447
+
448
+ echo $before_widget;
449
+
450
+ meteor_slideshow();
451
+
452
+ echo $after_widget;
453
+
454
+ }
455
+
456
+ }
457
+
458
  ?>
meteor-slides-settings.php CHANGED
@@ -96,7 +96,7 @@
96
 
97
  <h3>Install Slideshow</h3>
98
 
99
- <p>Use <code><&#63;php if(function_exists('meteor_slideshow')) { meteor_slideshow(); } &#63;></code> to add this slideshow to your theme, or use <code>[meteor_slideshow]</code> to add it to your Post or Page content.
100
 
101
  <p><em>Please <a title="Post a question or problem in the forums" href="http://wordpress.org/tags/meteor-slides?forum_id=10#postform">post any questions or problems</a> in the WordPress.org support forums.</em></p>
102
 
96
 
97
  <h3>Install Slideshow</h3>
98
 
99
+ <p>Use <code><&#63;php if(function_exists('meteor_slideshow')) { meteor_slideshow(); } &#63;></code> to add this slideshow to your theme, use <code>[meteor_slideshow]</code> to add it to your Post or Page content, or use the Meteor Slides Widget to add it to a sidebar.
100
 
101
  <p><em>Please <a title="Post a question or problem in the forums" href="http://wordpress.org/tags/meteor-slides?forum_id=10#postform">post any questions or problems</a> in the WordPress.org support forums.</em></p>
102
 
meteor-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  $loop = new WP_Query( array( 'post_type' => 'slide', 'posts_per_page' => $options['slideshow_quantity'] ) ); ?>
6
 
7
- <div class="meteor-slideshow" style="height:<?php echo $options['slide_height'] ?>px; width:<?php echo $options['slide_width'] ?>px; overflow:hidden;">
8
 
9
  <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
10
 
@@ -26,4 +26,4 @@
26
 
27
  <?php wp_reset_query(); ?>
28
 
29
- </div><!-- .meteor-slideshow -->
4
 
5
  $loop = new WP_Query( array( 'post_type' => 'slide', 'posts_per_page' => $options['slideshow_quantity'] ) ); ?>
6
 
7
+ <div id="meteor-slideshow">
8
 
9
  <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
10
 
26
 
27
  <?php wp_reset_query(); ?>
28
 
29
+ </div><!-- #meteor-slideshow -->
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: JLeuze
3
  Tags: slide, slider, slideshow, custom post types, jquery
4
  Requires at least: 3.0
5
  Tested up to: 3.0
6
- Stable tag: 1.0.2
7
 
8
  Adds a custom post type for slides to WordPress. Use Meteor Slides to create a quick little slideshow for your site.
9
 
@@ -22,9 +22,9 @@ The slides are managed as featured images through the media library; they will a
22
  = Future Features =
23
 
24
  * Multiple slideshows.
 
25
  * Choose which slides display.
26
  * Reorder slides.
27
- * Slideshow widget.
28
 
29
  [*Got an idea for a feature?*](http://wordpress.org/tags/meteor-slides?forum_id=10#postform "Post feedback or ideas in the forums")
30
 
@@ -32,10 +32,31 @@ The slides are managed as featured images through the media library; they will a
32
 
33
  1. Upload the `meteor-slides` folder to your `/wp-content/plugins/` directory.
34
  2. Activate the plugin through the 'Plugins' menu in WordPress
35
- 3. Use `<?php if(function_exists('meteor_slideshow')) { meteor_slideshow(); } ?>` to add this slideshow to your theme, or use `[meteor_slideshow]` to add it to your Post or Page content.
36
 
37
  Before adding any slides, go to the Meteor Slides Settings page and set the slide height and width so that those slides are cropped to the correct size.
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  *Please [post any questions or problems](http://wordpress.org/tags/meteor-slides?forum_id=10#postform "Post a question or problem in the forums") in the WordPress.org support forums.*
40
 
41
  == Screenshots ==
@@ -45,6 +66,9 @@ Before adding any slides, go to the Meteor Slides Settings page and set the slid
45
 
46
  == Changelog ==
47
 
 
 
 
48
  = 1.0.2 =
49
  * Fixed shortcode bugs, positioning of slideshow and loop within loop.
50
 
@@ -52,4 +76,9 @@ Before adding any slides, go to the Meteor Slides Settings page and set the slid
52
  * Removed "menu_position" to prevent conflicts with other plugins.
53
 
54
  = 1.0 =
55
- * Initial release of Meteor Slides.
 
 
 
 
 
3
  Tags: slide, slider, slideshow, custom post types, jquery
4
  Requires at least: 3.0
5
  Tested up to: 3.0
6
+ Stable tag: 1.1
7
 
8
  Adds a custom post type for slides to WordPress. Use Meteor Slides to create a quick little slideshow for your site.
9
 
22
  = Future Features =
23
 
24
  * Multiple slideshows.
25
+ * Localization support.
26
  * Choose which slides display.
27
  * Reorder slides.
 
28
 
29
  [*Got an idea for a feature?*](http://wordpress.org/tags/meteor-slides?forum_id=10#postform "Post feedback or ideas in the forums")
30
 
32
 
33
  1. Upload the `meteor-slides` folder to your `/wp-content/plugins/` directory.
34
  2. Activate the plugin through the 'Plugins' menu in WordPress
35
+ 3. Use `<?php if(function_exists('meteor_slideshow')) { meteor_slideshow(); } ?>` to add this slideshow to your theme, use `[meteor_slideshow]` to add it to your Post or Page content, or use the Meteor Slides Widget to add it to a sidebar.
36
 
37
  Before adding any slides, go to the Meteor Slides Settings page and set the slide height and width so that those slides are cropped to the correct size.
38
 
39
+ = Meteor Slides Screencast =
40
+ This short screencast explains how to set up Meteor Slides, create new slides, and add the slideshow to your site using the shortcode or template tag.
41
+
42
+ [vimeo http://vimeo.com/12901374]
43
+
44
+ *Please [post any questions or problems](http://wordpress.org/tags/meteor-slides?forum_id=10#postform "Post a question or problem in the forums") in the WordPress.org support forums.*
45
+
46
+ == Frequently Asked Questions ==
47
+
48
+ = I added an image to my post, why isn't it showing up in the slide? =
49
+
50
+ Make sure to click "Use as featured image" after uploading your image.
51
+
52
+ = Why is the slideshow covering up my dropdown menus? =
53
+
54
+ The `z-index` on the slideshow is higher than the dropdowns, cause them to be layered below the slides. Lower the `z-index` of `#meteor-slideshow` until the dropdowns are above the slideshow.
55
+
56
+ = How do I customize the slideshow's CSS stylesheet? =
57
+
58
+ Copy `meteor-slides.css` from `/meteor-slides/css/` to your theme's directory to replace the default stylesheet.
59
+
60
  *Please [post any questions or problems](http://wordpress.org/tags/meteor-slides?forum_id=10#postform "Post a question or problem in the forums") in the WordPress.org support forums.*
61
 
62
  == Screenshots ==
66
 
67
  == Changelog ==
68
 
69
+ = 1.1 =
70
+ * Added slideshow widget, added stylesheet, updated JQuery Cycle to 2.88.
71
+
72
  = 1.0.2 =
73
  * Fixed shortcode bugs, positioning of slideshow and loop within loop.
74
 
76
  * Removed "menu_position" to prevent conflicts with other plugins.
77
 
78
  = 1.0 =
79
+ * Initial release of Meteor Slides.
80
+
81
+ == Upgrade Notice ==
82
+
83
+ = 1.1 =
84
+ This version of Meteor Slides adds a stylesheet for the slideshow which aids theme compatability.