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