Version Description
- Number of logos to be displayed in iPad - Fixed
Download this release
Release Info
Developer | EnigmaWeb |
Plugin | Logo Slider |
Version | 1.4.4 |
Comparing to | |
See all releases |
Code changes from version 1.4.2 to 1.4.4
- lgs_jquery.cycle2.js +1534 -0
- logo-slider.php +69 -90
- readme.txt +34 -2
lgs_jquery.cycle2.js
ADDED
@@ -0,0 +1,1534 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery Cycle2; version: 2.1.2 build: 20140216
|
3 |
+
* http://jquery.malsup.com/cycle2/
|
4 |
+
* Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
|
5 |
+
*/
|
6 |
+
|
7 |
+
/* Cycle2 core engine */
|
8 |
+
;(function($) {
|
9 |
+
"use strict";
|
10 |
+
|
11 |
+
var version = '2.1.2';
|
12 |
+
|
13 |
+
$.fn.cycle = function( options ) {
|
14 |
+
// fix mistakes with the ready state
|
15 |
+
var o;
|
16 |
+
if ( this.length === 0 && !$.isReady ) {
|
17 |
+
o = { s: this.selector, c: this.context };
|
18 |
+
$.fn.cycle.log('requeuing slideshow (dom not ready)');
|
19 |
+
$(function() {
|
20 |
+
$( o.s, o.c ).cycle(options);
|
21 |
+
});
|
22 |
+
return this;
|
23 |
+
}
|
24 |
+
|
25 |
+
return this.each(function() {
|
26 |
+
var data, opts, shortName, val;
|
27 |
+
var container = $(this);
|
28 |
+
var log = $.fn.cycle.log;
|
29 |
+
|
30 |
+
if ( container.data('cycle.opts') )
|
31 |
+
return; // already initialized
|
32 |
+
|
33 |
+
if ( container.data('cycle-log') === false ||
|
34 |
+
( options && options.log === false ) ||
|
35 |
+
( opts && opts.log === false) ) {
|
36 |
+
log = $.noop;
|
37 |
+
}
|
38 |
+
|
39 |
+
log('--c2 init--');
|
40 |
+
data = container.data();
|
41 |
+
for (var p in data) {
|
42 |
+
// allow props to be accessed sans 'cycle' prefix and log the overrides
|
43 |
+
if (data.hasOwnProperty(p) && /^cycle[A-Z]+/.test(p) ) {
|
44 |
+
val = data[p];
|
45 |
+
shortName = p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, lowerCase);
|
46 |
+
log(shortName+':', val, '('+typeof val +')');
|
47 |
+
data[shortName] = val;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
opts = $.extend( {}, $.fn.cycle.defaults, data, options || {});
|
52 |
+
|
53 |
+
opts.timeoutId = 0;
|
54 |
+
opts.paused = opts.paused || false; // #57
|
55 |
+
opts.container = container;
|
56 |
+
opts._maxZ = opts.maxZ;
|
57 |
+
|
58 |
+
opts.API = $.extend ( { _container: container }, $.fn.cycle.API );
|
59 |
+
opts.API.log = log;
|
60 |
+
opts.API.trigger = function( eventName, args ) {
|
61 |
+
opts.container.trigger( eventName, args );
|
62 |
+
return opts.API;
|
63 |
+
};
|
64 |
+
|
65 |
+
container.data( 'cycle.opts', opts );
|
66 |
+
container.data( 'cycle.API', opts.API );
|
67 |
+
|
68 |
+
// opportunity for plugins to modify opts and API
|
69 |
+
opts.API.trigger('cycle-bootstrap', [ opts, opts.API ]);
|
70 |
+
|
71 |
+
opts.API.addInitialSlides();
|
72 |
+
opts.API.preInitSlideshow();
|
73 |
+
|
74 |
+
if ( opts.slides.length )
|
75 |
+
opts.API.initSlideshow();
|
76 |
+
});
|
77 |
+
};
|
78 |
+
|
79 |
+
$.fn.cycle.API = {
|
80 |
+
opts: function() {
|
81 |
+
return this._container.data( 'cycle.opts' );
|
82 |
+
},
|
83 |
+
addInitialSlides: function() {
|
84 |
+
var opts = this.opts();
|
85 |
+
var slides = opts.slides;
|
86 |
+
opts.slideCount = 0;
|
87 |
+
opts.slides = $(); // empty set
|
88 |
+
|
89 |
+
// add slides that already exist
|
90 |
+
slides = slides.jquery ? slides : opts.container.find( slides );
|
91 |
+
|
92 |
+
if ( opts.random ) {
|
93 |
+
slides.sort(function() {return Math.random() - 0.5;});
|
94 |
+
}
|
95 |
+
|
96 |
+
opts.API.add( slides );
|
97 |
+
},
|
98 |
+
|
99 |
+
preInitSlideshow: function() {
|
100 |
+
var opts = this.opts();
|
101 |
+
opts.API.trigger('cycle-pre-initialize', [ opts ]);
|
102 |
+
var tx = $.fn.cycle.transitions[opts.fx];
|
103 |
+
if (tx && $.isFunction(tx.preInit))
|
104 |
+
tx.preInit( opts );
|
105 |
+
opts._preInitialized = true;
|
106 |
+
},
|
107 |
+
|
108 |
+
postInitSlideshow: function() {
|
109 |
+
var opts = this.opts();
|
110 |
+
opts.API.trigger('cycle-post-initialize', [ opts ]);
|
111 |
+
var tx = $.fn.cycle.transitions[opts.fx];
|
112 |
+
if (tx && $.isFunction(tx.postInit))
|
113 |
+
tx.postInit( opts );
|
114 |
+
},
|
115 |
+
|
116 |
+
initSlideshow: function() {
|
117 |
+
var opts = this.opts();
|
118 |
+
var pauseObj = opts.container;
|
119 |
+
var slideOpts;
|
120 |
+
opts.API.calcFirstSlide();
|
121 |
+
|
122 |
+
if ( opts.container.css('position') == 'static' )
|
123 |
+
opts.container.css('position', 'relative');
|
124 |
+
|
125 |
+
$(opts.slides[opts.currSlide]).css({
|
126 |
+
opacity: 1,
|
127 |
+
display: 'block',
|
128 |
+
visibility: 'visible'
|
129 |
+
});
|
130 |
+
opts.API.stackSlides( opts.slides[opts.currSlide], opts.slides[opts.nextSlide], !opts.reverse );
|
131 |
+
|
132 |
+
if ( opts.pauseOnHover ) {
|
133 |
+
// allow pauseOnHover to specify an element
|
134 |
+
if ( opts.pauseOnHover !== true )
|
135 |
+
pauseObj = $( opts.pauseOnHover );
|
136 |
+
|
137 |
+
pauseObj.hover(
|
138 |
+
function(){ opts.API.pause( true ); },
|
139 |
+
function(){ opts.API.resume( true ); }
|
140 |
+
);
|
141 |
+
}
|
142 |
+
|
143 |
+
// stage initial transition
|
144 |
+
if ( opts.timeout ) {
|
145 |
+
slideOpts = opts.API.getSlideOpts( opts.currSlide );
|
146 |
+
opts.API.queueTransition( slideOpts, slideOpts.timeout + opts.delay );
|
147 |
+
}
|
148 |
+
|
149 |
+
opts._initialized = true;
|
150 |
+
opts.API.updateView( true );
|
151 |
+
opts.API.trigger('cycle-initialized', [ opts ]);
|
152 |
+
opts.API.postInitSlideshow();
|
153 |
+
},
|
154 |
+
|
155 |
+
pause: function( hover ) {
|
156 |
+
var opts = this.opts(),
|
157 |
+
slideOpts = opts.API.getSlideOpts(),
|
158 |
+
alreadyPaused = opts.hoverPaused || opts.paused;
|
159 |
+
|
160 |
+
if ( hover )
|
161 |
+
opts.hoverPaused = true;
|
162 |
+
else
|
163 |
+
opts.paused = true;
|
164 |
+
|
165 |
+
if ( ! alreadyPaused ) {
|
166 |
+
opts.container.addClass('cycle-paused');
|
167 |
+
opts.API.trigger('cycle-paused', [ opts ]).log('cycle-paused');
|
168 |
+
|
169 |
+
if ( slideOpts.timeout ) {
|
170 |
+
clearTimeout( opts.timeoutId );
|
171 |
+
opts.timeoutId = 0;
|
172 |
+
|
173 |
+
// determine how much time is left for the current slide
|
174 |
+
opts._remainingTimeout -= ( $.now() - opts._lastQueue );
|
175 |
+
if ( opts._remainingTimeout < 0 || isNaN(opts._remainingTimeout) )
|
176 |
+
opts._remainingTimeout = undefined;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
},
|
180 |
+
|
181 |
+
resume: function( hover ) {
|
182 |
+
var opts = this.opts(),
|
183 |
+
alreadyResumed = !opts.hoverPaused && !opts.paused,
|
184 |
+
remaining;
|
185 |
+
|
186 |
+
if ( hover )
|
187 |
+
opts.hoverPaused = false;
|
188 |
+
else
|
189 |
+
opts.paused = false;
|
190 |
+
|
191 |
+
|
192 |
+
if ( ! alreadyResumed ) {
|
193 |
+
opts.container.removeClass('cycle-paused');
|
194 |
+
// #gh-230; if an animation is in progress then don't queue a new transition; it will
|
195 |
+
// happen naturally
|
196 |
+
if ( opts.slides.filter(':animated').length === 0 )
|
197 |
+
opts.API.queueTransition( opts.API.getSlideOpts(), opts._remainingTimeout );
|
198 |
+
opts.API.trigger('cycle-resumed', [ opts, opts._remainingTimeout ] ).log('cycle-resumed');
|
199 |
+
}
|
200 |
+
},
|
201 |
+
|
202 |
+
add: function( slides, prepend ) {
|
203 |
+
var opts = this.opts();
|
204 |
+
var oldSlideCount = opts.slideCount;
|
205 |
+
var startSlideshow = false;
|
206 |
+
var len;
|
207 |
+
|
208 |
+
if ( $.type(slides) == 'string')
|
209 |
+
slides = $.trim( slides );
|
210 |
+
|
211 |
+
$( slides ).each(function(i) {
|
212 |
+
var slideOpts;
|
213 |
+
var slide = $(this);
|
214 |
+
|
215 |
+
if ( prepend )
|
216 |
+
opts.container.prepend( slide );
|
217 |
+
else
|
218 |
+
opts.container.append( slide );
|
219 |
+
|
220 |
+
opts.slideCount++;
|
221 |
+
slideOpts = opts.API.buildSlideOpts( slide );
|
222 |
+
|
223 |
+
if ( prepend )
|
224 |
+
opts.slides = $( slide ).add( opts.slides );
|
225 |
+
else
|
226 |
+
opts.slides = opts.slides.add( slide );
|
227 |
+
|
228 |
+
opts.API.initSlide( slideOpts, slide, --opts._maxZ );
|
229 |
+
|
230 |
+
slide.data('cycle.opts', slideOpts);
|
231 |
+
opts.API.trigger('cycle-slide-added', [ opts, slideOpts, slide ]);
|
232 |
+
});
|
233 |
+
|
234 |
+
opts.API.updateView( true );
|
235 |
+
|
236 |
+
startSlideshow = opts._preInitialized && (oldSlideCount < 2 && opts.slideCount >= 1);
|
237 |
+
if ( startSlideshow ) {
|
238 |
+
if ( !opts._initialized )
|
239 |
+
opts.API.initSlideshow();
|
240 |
+
else if ( opts.timeout ) {
|
241 |
+
len = opts.slides.length;
|
242 |
+
opts.nextSlide = opts.reverse ? len - 1 : 1;
|
243 |
+
if ( !opts.timeoutId ) {
|
244 |
+
opts.API.queueTransition( opts );
|
245 |
+
}
|
246 |
+
}
|
247 |
+
}
|
248 |
+
},
|
249 |
+
|
250 |
+
calcFirstSlide: function() {
|
251 |
+
var opts = this.opts();
|
252 |
+
var firstSlideIndex;
|
253 |
+
firstSlideIndex = parseInt( opts.startingSlide || 0, 10 );
|
254 |
+
if (firstSlideIndex >= opts.slides.length || firstSlideIndex < 0)
|
255 |
+
firstSlideIndex = 0;
|
256 |
+
|
257 |
+
opts.currSlide = firstSlideIndex;
|
258 |
+
if ( opts.reverse ) {
|
259 |
+
opts.nextSlide = firstSlideIndex - 1;
|
260 |
+
if (opts.nextSlide < 0)
|
261 |
+
opts.nextSlide = opts.slides.length - 1;
|
262 |
+
}
|
263 |
+
else {
|
264 |
+
opts.nextSlide = firstSlideIndex + 1;
|
265 |
+
if (opts.nextSlide == opts.slides.length)
|
266 |
+
opts.nextSlide = 0;
|
267 |
+
}
|
268 |
+
},
|
269 |
+
|
270 |
+
calcNextSlide: function() {
|
271 |
+
var opts = this.opts();
|
272 |
+
var roll;
|
273 |
+
if ( opts.reverse ) {
|
274 |
+
roll = (opts.nextSlide - 1) < 0;
|
275 |
+
opts.nextSlide = roll ? opts.slideCount - 1 : opts.nextSlide-1;
|
276 |
+
opts.currSlide = roll ? 0 : opts.nextSlide+1;
|
277 |
+
}
|
278 |
+
else {
|
279 |
+
roll = (opts.nextSlide + 1) == opts.slides.length;
|
280 |
+
opts.nextSlide = roll ? 0 : opts.nextSlide+1;
|
281 |
+
opts.currSlide = roll ? opts.slides.length-1 : opts.nextSlide-1;
|
282 |
+
}
|
283 |
+
},
|
284 |
+
|
285 |
+
calcTx: function( slideOpts, manual ) {
|
286 |
+
var opts = slideOpts;
|
287 |
+
var tx;
|
288 |
+
if ( manual && opts.manualFx )
|
289 |
+
tx = $.fn.cycle.transitions[opts.manualFx];
|
290 |
+
if ( !tx )
|
291 |
+
tx = $.fn.cycle.transitions[opts.fx];
|
292 |
+
|
293 |
+
if (!tx) {
|
294 |
+
tx = $.fn.cycle.transitions.fade;
|
295 |
+
opts.API.log('Transition "' + opts.fx + '" not found. Using fade.');
|
296 |
+
}
|
297 |
+
return tx;
|
298 |
+
},
|
299 |
+
|
300 |
+
prepareTx: function( manual, fwd ) {
|
301 |
+
var opts = this.opts();
|
302 |
+
var after, curr, next, slideOpts, tx;
|
303 |
+
|
304 |
+
if ( opts.slideCount < 2 ) {
|
305 |
+
opts.timeoutId = 0;
|
306 |
+
return;
|
307 |
+
}
|
308 |
+
if ( manual && ( !opts.busy || opts.manualTrump ) ) {
|
309 |
+
opts.API.stopTransition();
|
310 |
+
opts.busy = false;
|
311 |
+
clearTimeout(opts.timeoutId);
|
312 |
+
opts.timeoutId = 0;
|
313 |
+
}
|
314 |
+
if ( opts.busy )
|
315 |
+
return;
|
316 |
+
if ( opts.timeoutId === 0 && !manual )
|
317 |
+
return;
|
318 |
+
|
319 |
+
curr = opts.slides[opts.currSlide];
|
320 |
+
next = opts.slides[opts.nextSlide];
|
321 |
+
slideOpts = opts.API.getSlideOpts( opts.nextSlide );
|
322 |
+
tx = opts.API.calcTx( slideOpts, manual );
|
323 |
+
|
324 |
+
opts._tx = tx;
|
325 |
+
|
326 |
+
if ( manual && slideOpts.manualSpeed !== undefined )
|
327 |
+
slideOpts.speed = slideOpts.manualSpeed;
|
328 |
+
|
329 |
+
// if ( opts.nextSlide === opts.currSlide )
|
330 |
+
// opts.API.calcNextSlide();
|
331 |
+
|
332 |
+
// ensure that:
|
333 |
+
// 1. advancing to a different slide
|
334 |
+
// 2. this is either a manual event (prev/next, pager, cmd) or
|
335 |
+
// a timer event and slideshow is not paused
|
336 |
+
if ( opts.nextSlide != opts.currSlide &&
|
337 |
+
(manual || (!opts.paused && !opts.hoverPaused && opts.timeout) )) { // #62
|
338 |
+
|
339 |
+
opts.API.trigger('cycle-before', [ slideOpts, curr, next, fwd ]);
|
340 |
+
if ( tx.before )
|
341 |
+
tx.before( slideOpts, curr, next, fwd );
|
342 |
+
|
343 |
+
after = function() {
|
344 |
+
opts.busy = false;
|
345 |
+
// #76; bail if slideshow has been destroyed
|
346 |
+
if (! opts.container.data( 'cycle.opts' ) )
|
347 |
+
return;
|
348 |
+
|
349 |
+
if (tx.after)
|
350 |
+
tx.after( slideOpts, curr, next, fwd );
|
351 |
+
opts.API.trigger('cycle-after', [ slideOpts, curr, next, fwd ]);
|
352 |
+
opts.API.queueTransition( slideOpts);
|
353 |
+
opts.API.updateView( true );
|
354 |
+
};
|
355 |
+
|
356 |
+
opts.busy = true;
|
357 |
+
if (tx.transition)
|
358 |
+
tx.transition(slideOpts, curr, next, fwd, after);
|
359 |
+
else
|
360 |
+
opts.API.doTransition( slideOpts, curr, next, fwd, after);
|
361 |
+
|
362 |
+
opts.API.calcNextSlide();
|
363 |
+
opts.API.updateView();
|
364 |
+
} else {
|
365 |
+
opts.API.queueTransition( slideOpts );
|
366 |
+
}
|
367 |
+
},
|
368 |
+
|
369 |
+
// perform the actual animation
|
370 |
+
doTransition: function( slideOpts, currEl, nextEl, fwd, callback) {
|
371 |
+
var opts = slideOpts;
|
372 |
+
var curr = $(currEl), next = $(nextEl);
|
373 |
+
var fn = function() {
|
374 |
+
// make sure animIn has something so that callback doesn't trigger immediately
|
375 |
+
next.animate(opts.animIn || { opacity: 1}, opts.speed, opts.easeIn || opts.easing, callback);
|
376 |
+
};
|
377 |
+
|
378 |
+
next.css(opts.cssBefore || {});
|
379 |
+
curr.animate(opts.animOut || {}, opts.speed, opts.easeOut || opts.easing, function() {
|
380 |
+
curr.css(opts.cssAfter || {});
|
381 |
+
if (!opts.sync) {
|
382 |
+
fn();
|
383 |
+
}
|
384 |
+
});
|
385 |
+
if (opts.sync) {
|
386 |
+
fn();
|
387 |
+
}
|
388 |
+
},
|
389 |
+
|
390 |
+
queueTransition: function( slideOpts, specificTimeout ) {
|
391 |
+
var opts = this.opts();
|
392 |
+
var timeout = specificTimeout !== undefined ? specificTimeout : slideOpts.timeout;
|
393 |
+
if (opts.nextSlide === 0 && --opts.loop === 0) {
|
394 |
+
opts.API.log('terminating; loop=0');
|
395 |
+
opts.timeout = 0;
|
396 |
+
if ( timeout ) {
|
397 |
+
setTimeout(function() {
|
398 |
+
opts.API.trigger('cycle-finished', [ opts ]);
|
399 |
+
}, timeout);
|
400 |
+
}
|
401 |
+
else {
|
402 |
+
opts.API.trigger('cycle-finished', [ opts ]);
|
403 |
+
}
|
404 |
+
// reset nextSlide
|
405 |
+
opts.nextSlide = opts.currSlide;
|
406 |
+
return;
|
407 |
+
}
|
408 |
+
if ( opts.continueAuto !== undefined ) {
|
409 |
+
if ( opts.continueAuto === false ||
|
410 |
+
($.isFunction(opts.continueAuto) && opts.continueAuto() === false )) {
|
411 |
+
opts.API.log('terminating automatic transitions');
|
412 |
+
opts.timeout = 0;
|
413 |
+
if ( opts.timeoutId )
|
414 |
+
clearTimeout(opts.timeoutId);
|
415 |
+
return;
|
416 |
+
}
|
417 |
+
}
|
418 |
+
if ( timeout ) {
|
419 |
+
opts._lastQueue = $.now();
|
420 |
+
if ( specificTimeout === undefined )
|
421 |
+
opts._remainingTimeout = slideOpts.timeout;
|
422 |
+
|
423 |
+
if ( !opts.paused && ! opts.hoverPaused ) {
|
424 |
+
opts.timeoutId = setTimeout(function() {
|
425 |
+
opts.API.prepareTx( false, !opts.reverse );
|
426 |
+
}, timeout );
|
427 |
+
}
|
428 |
+
}
|
429 |
+
},
|
430 |
+
|
431 |
+
stopTransition: function() {
|
432 |
+
var opts = this.opts();
|
433 |
+
if ( opts.slides.filter(':animated').length ) {
|
434 |
+
opts.slides.stop(false, true);
|
435 |
+
opts.API.trigger('cycle-transition-stopped', [ opts ]);
|
436 |
+
}
|
437 |
+
|
438 |
+
if ( opts._tx && opts._tx.stopTransition )
|
439 |
+
opts._tx.stopTransition( opts );
|
440 |
+
},
|
441 |
+
|
442 |
+
// advance slide forward or back
|
443 |
+
advanceSlide: function( val ) {
|
444 |
+
var opts = this.opts();
|
445 |
+
clearTimeout(opts.timeoutId);
|
446 |
+
opts.timeoutId = 0;
|
447 |
+
opts.nextSlide = opts.currSlide + val;
|
448 |
+
|
449 |
+
if (opts.nextSlide < 0)
|
450 |
+
opts.nextSlide = opts.slides.length - 1;
|
451 |
+
else if (opts.nextSlide >= opts.slides.length)
|
452 |
+
opts.nextSlide = 0;
|
453 |
+
|
454 |
+
opts.API.prepareTx( true, val >= 0 );
|
455 |
+
return false;
|
456 |
+
},
|
457 |
+
|
458 |
+
buildSlideOpts: function( slide ) {
|
459 |
+
var opts = this.opts();
|
460 |
+
var val, shortName;
|
461 |
+
var slideOpts = slide.data() || {};
|
462 |
+
for (var p in slideOpts) {
|
463 |
+
// allow props to be accessed sans 'cycle' prefix and log the overrides
|
464 |
+
if (slideOpts.hasOwnProperty(p) && /^cycle[A-Z]+/.test(p) ) {
|
465 |
+
val = slideOpts[p];
|
466 |
+
shortName = p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, lowerCase);
|
467 |
+
opts.API.log('['+(opts.slideCount-1)+']', shortName+':', val, '('+typeof val +')');
|
468 |
+
slideOpts[shortName] = val;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
slideOpts = $.extend( {}, $.fn.cycle.defaults, opts, slideOpts );
|
473 |
+
slideOpts.slideNum = opts.slideCount;
|
474 |
+
|
475 |
+
try {
|
476 |
+
// these props should always be read from the master state object
|
477 |
+
delete slideOpts.API;
|
478 |
+
delete slideOpts.slideCount;
|
479 |
+
|
480 |
+
delete slideOpts.currSlide;
|
481 |
+
delete slideOpts.nextSlide;
|
482 |
+
delete slideOpts.slides;
|
483 |
+
} catch(e) {
|
484 |
+
// no op
|
485 |
+
}
|
486 |
+
return slideOpts;
|
487 |
+
},
|
488 |
+
|
489 |
+
getSlideOpts: function( index ) {
|
490 |
+
var opts = this.opts();
|
491 |
+
if ( index === undefined )
|
492 |
+
index = opts.currSlide;
|
493 |
+
|
494 |
+
var slide = opts.slides[index];
|
495 |
+
var slideOpts = $(slide).data('cycle.opts');
|
496 |
+
return $.extend( {}, opts, slideOpts );
|
497 |
+
},
|
498 |
+
|
499 |
+
initSlide: function( slideOpts, slide, suggestedZindex ) {
|
500 |
+
var opts = this.opts();
|
501 |
+
slide.css( slideOpts.slideCss || {} );
|
502 |
+
if ( suggestedZindex > 0 )
|
503 |
+
slide.css( 'zIndex', suggestedZindex );
|
504 |
+
|
505 |
+
// ensure that speed settings are sane
|
506 |
+
if ( isNaN( slideOpts.speed ) )
|
507 |
+
slideOpts.speed = $.fx.speeds[slideOpts.speed] || $.fx.speeds._default;
|
508 |
+
if ( !slideOpts.sync )
|
509 |
+
slideOpts.speed = slideOpts.speed / 2;
|
510 |
+
|
511 |
+
slide.addClass( opts.slideClass );
|
512 |
+
},
|
513 |
+
|
514 |
+
updateView: function( isAfter, isDuring, forceEvent ) {
|
515 |
+
var opts = this.opts();
|
516 |
+
if ( !opts._initialized )
|
517 |
+
return;
|
518 |
+
var slideOpts = opts.API.getSlideOpts();
|
519 |
+
var currSlide = opts.slides[ opts.currSlide ];
|
520 |
+
|
521 |
+
if ( ! isAfter && isDuring !== true ) {
|
522 |
+
opts.API.trigger('cycle-update-view-before', [ opts, slideOpts, currSlide ]);
|
523 |
+
if ( opts.updateView < 0 )
|
524 |
+
return;
|
525 |
+
}
|
526 |
+
|
527 |
+
if ( opts.slideActiveClass ) {
|
528 |
+
opts.slides.removeClass( opts.slideActiveClass )
|
529 |
+
.eq( opts.currSlide ).addClass( opts.slideActiveClass );
|
530 |
+
}
|
531 |
+
|
532 |
+
if ( isAfter && opts.hideNonActive )
|
533 |
+
opts.slides.filter( ':not(.' + opts.slideActiveClass + ')' ).css('visibility', 'hidden');
|
534 |
+
|
535 |
+
if ( opts.updateView === 0 ) {
|
536 |
+
setTimeout(function() {
|
537 |
+
opts.API.trigger('cycle-update-view', [ opts, slideOpts, currSlide, isAfter ]);
|
538 |
+
}, slideOpts.speed / (opts.sync ? 2 : 1) );
|
539 |
+
}
|
540 |
+
|
541 |
+
if ( opts.updateView !== 0 )
|
542 |
+
opts.API.trigger('cycle-update-view', [ opts, slideOpts, currSlide, isAfter ]);
|
543 |
+
|
544 |
+
if ( isAfter )
|
545 |
+
opts.API.trigger('cycle-update-view-after', [ opts, slideOpts, currSlide ]);
|
546 |
+
},
|
547 |
+
|
548 |
+
getComponent: function( name ) {
|
549 |
+
var opts = this.opts();
|
550 |
+
var selector = opts[name];
|
551 |
+
if (typeof selector === 'string') {
|
552 |
+
// if selector is a child, sibling combinator, adjancent selector then use find, otherwise query full dom
|
553 |
+
return (/^\s*[\>|\+|~]/).test( selector ) ? opts.container.find( selector ) : $( selector );
|
554 |
+
}
|
555 |
+
if (selector.jquery)
|
556 |
+
return selector;
|
557 |
+
|
558 |
+
return $(selector);
|
559 |
+
},
|
560 |
+
|
561 |
+
stackSlides: function( curr, next, fwd ) {
|
562 |
+
var opts = this.opts();
|
563 |
+
if ( !curr ) {
|
564 |
+
curr = opts.slides[opts.currSlide];
|
565 |
+
next = opts.slides[opts.nextSlide];
|
566 |
+
fwd = !opts.reverse;
|
567 |
+
}
|
568 |
+
|
569 |
+
// reset the zIndex for the common case:
|
570 |
+
// curr slide on top, next slide beneath, and the rest in order to be shown
|
571 |
+
$(curr).css('zIndex', opts.maxZ);
|
572 |
+
|
573 |
+
var i;
|
574 |
+
var z = opts.maxZ - 2;
|
575 |
+
var len = opts.slideCount;
|
576 |
+
if (fwd) {
|
577 |
+
for ( i = opts.currSlide + 1; i < len; i++ )
|
578 |
+
$( opts.slides[i] ).css( 'zIndex', z-- );
|
579 |
+
for ( i = 0; i < opts.currSlide; i++ )
|
580 |
+
$( opts.slides[i] ).css( 'zIndex', z-- );
|
581 |
+
}
|
582 |
+
else {
|
583 |
+
for ( i = opts.currSlide - 1; i >= 0; i-- )
|
584 |
+
$( opts.slides[i] ).css( 'zIndex', z-- );
|
585 |
+
for ( i = len - 1; i > opts.currSlide; i-- )
|
586 |
+
$( opts.slides[i] ).css( 'zIndex', z-- );
|
587 |
+
}
|
588 |
+
|
589 |
+
$(next).css('zIndex', opts.maxZ - 1);
|
590 |
+
},
|
591 |
+
|
592 |
+
getSlideIndex: function( el ) {
|
593 |
+
return this.opts().slides.index( el );
|
594 |
+
}
|
595 |
+
|
596 |
+
}; // API
|
597 |
+
|
598 |
+
// default logger
|
599 |
+
$.fn.cycle.log = function log() {
|
600 |
+
/*global console:true */
|
601 |
+
if (window.console && console.log)
|
602 |
+
console.log('[cycle2] ' + Array.prototype.join.call(arguments, ' ') );
|
603 |
+
};
|
604 |
+
|
605 |
+
$.fn.cycle.version = function() { return 'Cycle2: ' + version; };
|
606 |
+
|
607 |
+
// helper functions
|
608 |
+
|
609 |
+
function lowerCase(s) {
|
610 |
+
return (s || '').toLowerCase();
|
611 |
+
}
|
612 |
+
|
613 |
+
// expose transition object
|
614 |
+
$.fn.cycle.transitions = {
|
615 |
+
custom: {
|
616 |
+
},
|
617 |
+
none: {
|
618 |
+
before: function( opts, curr, next, fwd ) {
|
619 |
+
opts.API.stackSlides( next, curr, fwd );
|
620 |
+
opts.cssBefore = { opacity: 1, visibility: 'visible', display: 'block' };
|
621 |
+
}
|
622 |
+
},
|
623 |
+
fade: {
|
624 |
+
before: function( opts, curr, next, fwd ) {
|
625 |
+
var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
|
626 |
+
opts.API.stackSlides( curr, next, fwd );
|
627 |
+
opts.cssBefore = $.extend(css, { opacity: 0, visibility: 'visible', display: 'block' });
|
628 |
+
opts.animIn = { opacity: 1 };
|
629 |
+
opts.animOut = { opacity: 0 };
|
630 |
+
}
|
631 |
+
},
|
632 |
+
fadeout: {
|
633 |
+
before: function( opts , curr, next, fwd ) {
|
634 |
+
var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
|
635 |
+
opts.API.stackSlides( curr, next, fwd );
|
636 |
+
opts.cssBefore = $.extend(css, { opacity: 1, visibility: 'visible', display: 'block' });
|
637 |
+
opts.animOut = { opacity: 0 };
|
638 |
+
}
|
639 |
+
},
|
640 |
+
scrollHorz: {
|
641 |
+
before: function( opts, curr, next, fwd ) {
|
642 |
+
opts.API.stackSlides( curr, next, fwd );
|
643 |
+
var w = opts.container.css('overflow','hidden').width();
|
644 |
+
opts.cssBefore = { left: fwd ? w : - w, top: 0, opacity: 1, visibility: 'visible', display: 'block' };
|
645 |
+
opts.cssAfter = { zIndex: opts._maxZ - 2, left: 0 };
|
646 |
+
opts.animIn = { left: 0 };
|
647 |
+
opts.animOut = { left: fwd ? -w : w };
|
648 |
+
}
|
649 |
+
}
|
650 |
+
};
|
651 |
+
|
652 |
+
// @see: http://jquery.malsup.com/cycle2/api
|
653 |
+
$.fn.cycle.defaults = {
|
654 |
+
allowWrap: true,
|
655 |
+
autoSelector: '.cycle-slideshow[data-cycle-auto-init!=false]',
|
656 |
+
delay: 0,
|
657 |
+
easing: null,
|
658 |
+
fx: 'fade',
|
659 |
+
hideNonActive: true,
|
660 |
+
loop: 0,
|
661 |
+
manualFx: undefined,
|
662 |
+
manualSpeed: undefined,
|
663 |
+
manualTrump: true,
|
664 |
+
maxZ: 100,
|
665 |
+
pauseOnHover: false,
|
666 |
+
reverse: false,
|
667 |
+
slideActiveClass: 'cycle-slide-active',
|
668 |
+
slideClass: 'cycle-slide',
|
669 |
+
slideCss: { position: 'absolute', top: 0, left: 0 },
|
670 |
+
slides: '> img',
|
671 |
+
speed: 500,
|
672 |
+
startingSlide: 0,
|
673 |
+
sync: true,
|
674 |
+
timeout: 4000,
|
675 |
+
updateView: 0
|
676 |
+
};
|
677 |
+
|
678 |
+
// automatically find and run slideshows
|
679 |
+
$(document).ready(function() {
|
680 |
+
$( $.fn.cycle.defaults.autoSelector ).cycle();
|
681 |
+
});
|
682 |
+
|
683 |
+
})(jQuery);
|
684 |
+
|
685 |
+
/*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */
|
686 |
+
(function($) {
|
687 |
+
"use strict";
|
688 |
+
|
689 |
+
$.extend($.fn.cycle.defaults, {
|
690 |
+
autoHeight: 0, // setting this option to false disables autoHeight logic
|
691 |
+
autoHeightSpeed: 250,
|
692 |
+
autoHeightEasing: null
|
693 |
+
});
|
694 |
+
|
695 |
+
$(document).on( 'cycle-initialized', function( e, opts ) {
|
696 |
+
var autoHeight = opts.autoHeight;
|
697 |
+
var t = $.type( autoHeight );
|
698 |
+
var resizeThrottle = null;
|
699 |
+
var ratio;
|
700 |
+
|
701 |
+
if ( t !== 'string' && t !== 'number' )
|
702 |
+
return;
|
703 |
+
|
704 |
+
// bind events
|
705 |
+
opts.container.on( 'cycle-slide-added cycle-slide-removed', initAutoHeight );
|
706 |
+
opts.container.on( 'cycle-destroyed', onDestroy );
|
707 |
+
|
708 |
+
if ( autoHeight == 'container' ) {
|
709 |
+
opts.container.on( 'cycle-before', onBefore );
|
710 |
+
}
|
711 |
+
else if ( t === 'string' && /\d+\:\d+/.test( autoHeight ) ) {
|
712 |
+
// use ratio
|
713 |
+
ratio = autoHeight.match(/(\d+)\:(\d+)/);
|
714 |
+
ratio = ratio[1] / ratio[2];
|
715 |
+
opts._autoHeightRatio = ratio;
|
716 |
+
}
|
717 |
+
|
718 |
+
// if autoHeight is a number then we don't need to recalculate the sentinel
|
719 |
+
// index on resize
|
720 |
+
if ( t !== 'number' ) {
|
721 |
+
// bind unique resize handler per slideshow (so it can be 'off-ed' in onDestroy)
|
722 |
+
opts._autoHeightOnResize = function () {
|
723 |
+
clearTimeout( resizeThrottle );
|
724 |
+
resizeThrottle = setTimeout( onResize, 50 );
|
725 |
+
};
|
726 |
+
|
727 |
+
$(window).on( 'resize orientationchange', opts._autoHeightOnResize );
|
728 |
+
}
|
729 |
+
|
730 |
+
setTimeout( onResize, 30 );
|
731 |
+
|
732 |
+
function onResize() {
|
733 |
+
initAutoHeight( e, opts );
|
734 |
+
}
|
735 |
+
});
|
736 |
+
|
737 |
+
function initAutoHeight( e, opts ) {
|
738 |
+
var clone, height, sentinelIndex;
|
739 |
+
var autoHeight = opts.autoHeight;
|
740 |
+
|
741 |
+
if ( autoHeight == 'container' ) {
|
742 |
+
height = $( opts.slides[ opts.currSlide ] ).outerHeight();
|
743 |
+
opts.container.height( height );
|
744 |
+
}
|
745 |
+
else if ( opts._autoHeightRatio ) {
|
746 |
+
opts.container.height( opts.container.width() / opts._autoHeightRatio );
|
747 |
+
}
|
748 |
+
else if ( autoHeight === 'calc' || ( $.type( autoHeight ) == 'number' && autoHeight >= 0 ) ) {
|
749 |
+
if ( autoHeight === 'calc' )
|
750 |
+
sentinelIndex = calcSentinelIndex( e, opts );
|
751 |
+
else if ( autoHeight >= opts.slides.length )
|
752 |
+
sentinelIndex = 0;
|
753 |
+
else
|
754 |
+
sentinelIndex = autoHeight;
|
755 |
+
|
756 |
+
// only recreate sentinel if index is different
|
757 |
+
if ( sentinelIndex == opts._sentinelIndex )
|
758 |
+
return;
|
759 |
+
|
760 |
+
opts._sentinelIndex = sentinelIndex;
|
761 |
+
if ( opts._sentinel )
|
762 |
+
opts._sentinel.remove();
|
763 |
+
|
764 |
+
// clone existing slide as sentinel
|
765 |
+
clone = $( opts.slides[ sentinelIndex ].cloneNode(true) );
|
766 |
+
|
767 |
+
// #50; remove special attributes from cloned content
|
768 |
+
clone.removeAttr( 'id name rel' ).find( '[id],[name],[rel]' ).removeAttr( 'id name rel' );
|
769 |
+
|
770 |
+
clone.css({
|
771 |
+
position: 'static',
|
772 |
+
visibility: 'hidden',
|
773 |
+
display: 'block'
|
774 |
+
}).prependTo( opts.container ).addClass('cycle-sentinel cycle-slide').removeClass('cycle-slide-active');
|
775 |
+
clone.find( '*' ).css( 'visibility', 'hidden' );
|
776 |
+
|
777 |
+
opts._sentinel = clone;
|
778 |
+
}
|
779 |
+
}
|
780 |
+
|
781 |
+
function calcSentinelIndex( e, opts ) {
|
782 |
+
var index = 0, max = -1;
|
783 |
+
|
784 |
+
// calculate tallest slide index
|
785 |
+
opts.slides.each(function(i) {
|
786 |
+
var h = $(this).height();
|
787 |
+
if ( h > max ) {
|
788 |
+
max = h;
|
789 |
+
index = i;
|
790 |
+
}
|
791 |
+
});
|
792 |
+
return index;
|
793 |
+
}
|
794 |
+
|
795 |
+
function onBefore( e, opts, outgoing, incoming, forward ) {
|
796 |
+
var h = $(incoming).outerHeight();
|
797 |
+
opts.container.animate( { height: h }, opts.autoHeightSpeed, opts.autoHeightEasing );
|
798 |
+
}
|
799 |
+
|
800 |
+
function onDestroy( e, opts ) {
|
801 |
+
if ( opts._autoHeightOnResize ) {
|
802 |
+
$(window).off( 'resize orientationchange', opts._autoHeightOnResize );
|
803 |
+
opts._autoHeightOnResize = null;
|
804 |
+
}
|
805 |
+
opts.container.off( 'cycle-slide-added cycle-slide-removed', initAutoHeight );
|
806 |
+
opts.container.off( 'cycle-destroyed', onDestroy );
|
807 |
+
opts.container.off( 'cycle-before', onBefore );
|
808 |
+
|
809 |
+
if ( opts._sentinel ) {
|
810 |
+
opts._sentinel.remove();
|
811 |
+
opts._sentinel = null;
|
812 |
+
}
|
813 |
+
}
|
814 |
+
|
815 |
+
})(jQuery);
|
816 |
+
|
817 |
+
/*! caption plugin for Cycle2; version: 20130306 */
|
818 |
+
(function($) {
|
819 |
+
"use strict";
|
820 |
+
|
821 |
+
$.extend($.fn.cycle.defaults, {
|
822 |
+
caption: '> .cycle-caption',
|
823 |
+
captionTemplate: '{{slideNum}} / {{slideCount}}',
|
824 |
+
overlay: '> .cycle-overlay',
|
825 |
+
overlayTemplate: '<div>{{title}}</div><div>{{desc}}</div>',
|
826 |
+
captionModule: 'caption'
|
827 |
+
});
|
828 |
+
|
829 |
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts, currSlide ) {
|
830 |
+
if ( opts.captionModule !== 'caption' )
|
831 |
+
return;
|
832 |
+
var el;
|
833 |
+
$.each(['caption','overlay'], function() {
|
834 |
+
var name = this;
|
835 |
+
var template = slideOpts[name+'Template'];
|
836 |
+
var el = opts.API.getComponent( name );
|
837 |
+
if( el.length && template ) {
|
838 |
+
el.html( opts.API.tmpl( template, slideOpts, opts, currSlide ) );
|
839 |
+
el.show();
|
840 |
+
}
|
841 |
+
else {
|
842 |
+
el.hide();
|
843 |
+
}
|
844 |
+
});
|
845 |
+
});
|
846 |
+
|
847 |
+
$(document).on( 'cycle-destroyed', function( e, opts ) {
|
848 |
+
var el;
|
849 |
+
$.each(['caption','overlay'], function() {
|
850 |
+
var name = this, template = opts[name+'Template'];
|
851 |
+
if ( opts[name] && template ) {
|
852 |
+
el = opts.API.getComponent( 'caption' );
|
853 |
+
el.empty();
|
854 |
+
}
|
855 |
+
});
|
856 |
+
});
|
857 |
+
|
858 |
+
})(jQuery);
|
859 |
+
|
860 |
+
/*! command plugin for Cycle2; version: 20130707 */
|
861 |
+
(function($) {
|
862 |
+
"use strict";
|
863 |
+
|
864 |
+
var c2 = $.fn.cycle;
|
865 |
+
|
866 |
+
$.fn.cycle = function( options ) {
|
867 |
+
var cmd, cmdFn, opts;
|
868 |
+
var args = $.makeArray( arguments );
|
869 |
+
|
870 |
+
if ( $.type( options ) == 'number' ) {
|
871 |
+
return this.cycle( 'goto', options );
|
872 |
+
}
|
873 |
+
|
874 |
+
if ( $.type( options ) == 'string' ) {
|
875 |
+
return this.each(function() {
|
876 |
+
var cmdArgs;
|
877 |
+
cmd = options;
|
878 |
+
opts = $(this).data('cycle.opts');
|
879 |
+
|
880 |
+
if ( opts === undefined ) {
|
881 |
+
c2.log('slideshow must be initialized before sending commands; "' + cmd + '" ignored');
|
882 |
+
return;
|
883 |
+
}
|
884 |
+
else {
|
885 |
+
cmd = cmd == 'goto' ? 'jump' : cmd; // issue #3; change 'goto' to 'jump' internally
|
886 |
+
cmdFn = opts.API[ cmd ];
|
887 |
+
if ( $.isFunction( cmdFn )) {
|
888 |
+
cmdArgs = $.makeArray( args );
|
889 |
+
cmdArgs.shift();
|
890 |
+
return cmdFn.apply( opts.API, cmdArgs );
|
891 |
+
}
|
892 |
+
else {
|
893 |
+
c2.log( 'unknown command: ', cmd );
|
894 |
+
}
|
895 |
+
}
|
896 |
+
});
|
897 |
+
}
|
898 |
+
else {
|
899 |
+
return c2.apply( this, arguments );
|
900 |
+
}
|
901 |
+
};
|
902 |
+
|
903 |
+
// copy props
|
904 |
+
$.extend( $.fn.cycle, c2 );
|
905 |
+
|
906 |
+
$.extend( c2.API, {
|
907 |
+
next: function() {
|
908 |
+
var opts = this.opts();
|
909 |
+
if ( opts.busy && ! opts.manualTrump )
|
910 |
+
return;
|
911 |
+
|
912 |
+
var count = opts.reverse ? -1 : 1;
|
913 |
+
if ( opts.allowWrap === false && ( opts.currSlide + count ) >= opts.slideCount )
|
914 |
+
return;
|
915 |
+
|
916 |
+
opts.API.advanceSlide( count );
|
917 |
+
opts.API.trigger('cycle-next', [ opts ]).log('cycle-next');
|
918 |
+
},
|
919 |
+
|
920 |
+
prev: function() {
|
921 |
+
var opts = this.opts();
|
922 |
+
if ( opts.busy && ! opts.manualTrump )
|
923 |
+
return;
|
924 |
+
var count = opts.reverse ? 1 : -1;
|
925 |
+
if ( opts.allowWrap === false && ( opts.currSlide + count ) < 0 )
|
926 |
+
return;
|
927 |
+
|
928 |
+
opts.API.advanceSlide( count );
|
929 |
+
opts.API.trigger('cycle-prev', [ opts ]).log('cycle-prev');
|
930 |
+
},
|
931 |
+
|
932 |
+
destroy: function() {
|
933 |
+
this.stop(); //#204
|
934 |
+
|
935 |
+
var opts = this.opts();
|
936 |
+
var clean = $.isFunction( $._data ) ? $._data : $.noop; // hack for #184 and #201
|
937 |
+
clearTimeout(opts.timeoutId);
|
938 |
+
opts.timeoutId = 0;
|
939 |
+
opts.API.stop();
|
940 |
+
opts.API.trigger( 'cycle-destroyed', [ opts ] ).log('cycle-destroyed');
|
941 |
+
opts.container.removeData();
|
942 |
+
clean( opts.container[0], 'parsedAttrs', false );
|
943 |
+
|
944 |
+
// #75; remove inline styles
|
945 |
+
if ( ! opts.retainStylesOnDestroy ) {
|
946 |
+
opts.container.removeAttr( 'style' );
|
947 |
+
opts.slides.removeAttr( 'style' );
|
948 |
+
opts.slides.removeClass( opts.slideActiveClass );
|
949 |
+
}
|
950 |
+
opts.slides.each(function() {
|
951 |
+
$(this).removeData();
|
952 |
+
clean( this, 'parsedAttrs', false );
|
953 |
+
});
|
954 |
+
},
|
955 |
+
|
956 |
+
jump: function( index ) {
|
957 |
+
// go to the requested slide
|
958 |
+
var fwd;
|
959 |
+
var opts = this.opts();
|
960 |
+
if ( opts.busy && ! opts.manualTrump )
|
961 |
+
return;
|
962 |
+
var num = parseInt( index, 10 );
|
963 |
+
if (isNaN(num) || num < 0 || num >= opts.slides.length) {
|
964 |
+
opts.API.log('goto: invalid slide index: ' + num);
|
965 |
+
return;
|
966 |
+
}
|
967 |
+
if (num == opts.currSlide) {
|
968 |
+
opts.API.log('goto: skipping, already on slide', num);
|
969 |
+
return;
|
970 |
+
}
|
971 |
+
opts.nextSlide = num;
|
972 |
+
clearTimeout(opts.timeoutId);
|
973 |
+
opts.timeoutId = 0;
|
974 |
+
opts.API.log('goto: ', num, ' (zero-index)');
|
975 |
+
fwd = opts.currSlide < opts.nextSlide;
|
976 |
+
opts.API.prepareTx( true, fwd );
|
977 |
+
},
|
978 |
+
|
979 |
+
stop: function() {
|
980 |
+
var opts = this.opts();
|
981 |
+
var pauseObj = opts.container;
|
982 |
+
clearTimeout(opts.timeoutId);
|
983 |
+
opts.timeoutId = 0;
|
984 |
+
opts.API.stopTransition();
|
985 |
+
if ( opts.pauseOnHover ) {
|
986 |
+
if ( opts.pauseOnHover !== true )
|
987 |
+
pauseObj = $( opts.pauseOnHover );
|
988 |
+
pauseObj.off('mouseenter mouseleave');
|
989 |
+
}
|
990 |
+
opts.API.trigger('cycle-stopped', [ opts ]).log('cycle-stopped');
|
991 |
+
},
|
992 |
+
|
993 |
+
reinit: function() {
|
994 |
+
var opts = this.opts();
|
995 |
+
opts.API.destroy();
|
996 |
+
opts.container.cycle();
|
997 |
+
},
|
998 |
+
|
999 |
+
remove: function( index ) {
|
1000 |
+
var opts = this.opts();
|
1001 |
+
var slide, slideToRemove, slides = [], slideNum = 1;
|
1002 |
+
for ( var i=0; i < opts.slides.length; i++ ) {
|
1003 |
+
slide = opts.slides[i];
|
1004 |
+
if ( i == index ) {
|
1005 |
+
slideToRemove = slide;
|
1006 |
+
}
|
1007 |
+
else {
|
1008 |
+
slides.push( slide );
|
1009 |
+
$( slide ).data('cycle.opts').slideNum = slideNum;
|
1010 |
+
slideNum++;
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
if ( slideToRemove ) {
|
1014 |
+
opts.slides = $( slides );
|
1015 |
+
opts.slideCount--;
|
1016 |
+
$( slideToRemove ).remove();
|
1017 |
+
if (index == opts.currSlide)
|
1018 |
+
opts.API.advanceSlide( 1 );
|
1019 |
+
else if ( index < opts.currSlide )
|
1020 |
+
opts.currSlide--;
|
1021 |
+
else
|
1022 |
+
opts.currSlide++;
|
1023 |
+
|
1024 |
+
opts.API.trigger('cycle-slide-removed', [ opts, index, slideToRemove ]).log('cycle-slide-removed');
|
1025 |
+
opts.API.updateView();
|
1026 |
+
}
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
});
|
1030 |
+
|
1031 |
+
// listen for clicks on elements with data-cycle-cmd attribute
|
1032 |
+
$(document).on('click.cycle', '[data-cycle-cmd]', function(e) {
|
1033 |
+
// issue cycle command
|
1034 |
+
e.preventDefault();
|
1035 |
+
var el = $(this);
|
1036 |
+
var command = el.data('cycle-cmd');
|
1037 |
+
var context = el.data('cycle-context') || '.cycle-slideshow';
|
1038 |
+
$(context).cycle(command, el.data('cycle-arg'));
|
1039 |
+
});
|
1040 |
+
|
1041 |
+
|
1042 |
+
})(jQuery);
|
1043 |
+
|
1044 |
+
/*! hash plugin for Cycle2; version: 20130905 */
|
1045 |
+
(function($) {
|
1046 |
+
"use strict";
|
1047 |
+
|
1048 |
+
$(document).on( 'cycle-pre-initialize', function( e, opts ) {
|
1049 |
+
onHashChange( opts, true );
|
1050 |
+
|
1051 |
+
opts._onHashChange = function() {
|
1052 |
+
onHashChange( opts, false );
|
1053 |
+
};
|
1054 |
+
|
1055 |
+
$( window ).on( 'hashchange', opts._onHashChange);
|
1056 |
+
});
|
1057 |
+
|
1058 |
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts ) {
|
1059 |
+
if ( slideOpts.hash && ( '#' + slideOpts.hash ) != window.location.hash ) {
|
1060 |
+
opts._hashFence = true;
|
1061 |
+
window.location.hash = slideOpts.hash;
|
1062 |
+
}
|
1063 |
+
});
|
1064 |
+
|
1065 |
+
$(document).on( 'cycle-destroyed', function( e, opts) {
|
1066 |
+
if ( opts._onHashChange ) {
|
1067 |
+
$( window ).off( 'hashchange', opts._onHashChange );
|
1068 |
+
}
|
1069 |
+
});
|
1070 |
+
|
1071 |
+
function onHashChange( opts, setStartingSlide ) {
|
1072 |
+
var hash;
|
1073 |
+
if ( opts._hashFence ) {
|
1074 |
+
opts._hashFence = false;
|
1075 |
+
return;
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
hash = window.location.hash.substring(1);
|
1079 |
+
|
1080 |
+
opts.slides.each(function(i) {
|
1081 |
+
if ( $(this).data( 'cycle-hash' ) == hash ) {
|
1082 |
+
if ( setStartingSlide === true ) {
|
1083 |
+
opts.startingSlide = i;
|
1084 |
+
}
|
1085 |
+
else {
|
1086 |
+
var fwd = opts.currSlide < i;
|
1087 |
+
opts.nextSlide = i;
|
1088 |
+
opts.API.prepareTx( true, fwd );
|
1089 |
+
}
|
1090 |
+
return false;
|
1091 |
+
}
|
1092 |
+
});
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
})(jQuery);
|
1096 |
+
|
1097 |
+
/*! loader plugin for Cycle2; version: 20131121 */
|
1098 |
+
(function($) {
|
1099 |
+
"use strict";
|
1100 |
+
|
1101 |
+
$.extend($.fn.cycle.defaults, {
|
1102 |
+
loader: false
|
1103 |
+
});
|
1104 |
+
|
1105 |
+
$(document).on( 'cycle-bootstrap', function( e, opts ) {
|
1106 |
+
var addFn;
|
1107 |
+
|
1108 |
+
if ( !opts.loader )
|
1109 |
+
return;
|
1110 |
+
|
1111 |
+
// override API.add for this slideshow
|
1112 |
+
addFn = opts.API.add;
|
1113 |
+
opts.API.add = add;
|
1114 |
+
|
1115 |
+
function add( slides, prepend ) {
|
1116 |
+
var slideArr = [];
|
1117 |
+
if ( $.type( slides ) == 'string' )
|
1118 |
+
slides = $.trim( slides );
|
1119 |
+
else if ( $.type( slides) === 'array' ) {
|
1120 |
+
for (var i=0; i < slides.length; i++ )
|
1121 |
+
slides[i] = $(slides[i])[0];
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
slides = $( slides );
|
1125 |
+
var slideCount = slides.length;
|
1126 |
+
|
1127 |
+
if ( ! slideCount )
|
1128 |
+
return;
|
1129 |
+
|
1130 |
+
slides.css('visibility','hidden').appendTo('body').each(function(i) { // appendTo fixes #56
|
1131 |
+
var count = 0;
|
1132 |
+
var slide = $(this);
|
1133 |
+
var images = slide.is('img') ? slide : slide.find('img');
|
1134 |
+
slide.data('index', i);
|
1135 |
+
// allow some images to be marked as unimportant (and filter out images w/o src value)
|
1136 |
+
images = images.filter(':not(.cycle-loader-ignore)').filter(':not([src=""])');
|
1137 |
+
if ( ! images.length ) {
|
1138 |
+
--slideCount;
|
1139 |
+
slideArr.push( slide );
|
1140 |
+
return;
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
count = images.length;
|
1144 |
+
images.each(function() {
|
1145 |
+
// add images that are already loaded
|
1146 |
+
if ( this.complete ) {
|
1147 |
+
imageLoaded();
|
1148 |
+
}
|
1149 |
+
else {
|
1150 |
+
$(this).load(function() {
|
1151 |
+
imageLoaded();
|
1152 |
+
}).on("error", function() {
|
1153 |
+
if ( --count === 0 ) {
|
1154 |
+
// ignore this slide
|
1155 |
+
opts.API.log('slide skipped; img not loaded:', this.src);
|
1156 |
+
if ( --slideCount === 0 && opts.loader == 'wait') {
|
1157 |
+
addFn.apply( opts.API, [ slideArr, prepend ] );
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
});
|
1161 |
+
}
|
1162 |
+
});
|
1163 |
+
|
1164 |
+
function imageLoaded() {
|
1165 |
+
if ( --count === 0 ) {
|
1166 |
+
--slideCount;
|
1167 |
+
addSlide( slide );
|
1168 |
+
}
|
1169 |
+
}
|
1170 |
+
});
|
1171 |
+
|
1172 |
+
if ( slideCount )
|
1173 |
+
opts.container.addClass('cycle-loading');
|
1174 |
+
|
1175 |
+
|
1176 |
+
function addSlide( slide ) {
|
1177 |
+
var curr;
|
1178 |
+
if ( opts.loader == 'wait' ) {
|
1179 |
+
slideArr.push( slide );
|
1180 |
+
if ( slideCount === 0 ) {
|
1181 |
+
// #59; sort slides into original markup order
|
1182 |
+
slideArr.sort( sorter );
|
1183 |
+
addFn.apply( opts.API, [ slideArr, prepend ] );
|
1184 |
+
opts.container.removeClass('cycle-loading');
|
1185 |
+
}
|
1186 |
+
}
|
1187 |
+
else {
|
1188 |
+
curr = $(opts.slides[opts.currSlide]);
|
1189 |
+
addFn.apply( opts.API, [ slide, prepend ] );
|
1190 |
+
curr.show();
|
1191 |
+
opts.container.removeClass('cycle-loading');
|
1192 |
+
}
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
function sorter(a, b) {
|
1196 |
+
return a.data('index') - b.data('index');
|
1197 |
+
}
|
1198 |
+
}
|
1199 |
+
});
|
1200 |
+
|
1201 |
+
})(jQuery);
|
1202 |
+
|
1203 |
+
/*! pager plugin for Cycle2; version: 20130525 */
|
1204 |
+
(function($) {
|
1205 |
+
"use strict";
|
1206 |
+
|
1207 |
+
$.extend($.fn.cycle.defaults, {
|
1208 |
+
pager: '> .cycle-pager',
|
1209 |
+
pagerActiveClass: 'cycle-pager-active',
|
1210 |
+
pagerEvent: 'click.cycle',
|
1211 |
+
pagerTemplate: '<span>•</span>'
|
1212 |
+
});
|
1213 |
+
|
1214 |
+
$(document).on( 'cycle-bootstrap', function( e, opts, API ) {
|
1215 |
+
// add method to API
|
1216 |
+
API.buildPagerLink = buildPagerLink;
|
1217 |
+
});
|
1218 |
+
|
1219 |
+
$(document).on( 'cycle-slide-added', function( e, opts, slideOpts, slideAdded ) {
|
1220 |
+
if ( opts.pager ) {
|
1221 |
+
opts.API.buildPagerLink ( opts, slideOpts, slideAdded );
|
1222 |
+
opts.API.page = page;
|
1223 |
+
}
|
1224 |
+
});
|
1225 |
+
|
1226 |
+
$(document).on( 'cycle-slide-removed', function( e, opts, index, slideRemoved ) {
|
1227 |
+
if ( opts.pager ) {
|
1228 |
+
var pagers = opts.API.getComponent( 'pager' );
|
1229 |
+
pagers.each(function() {
|
1230 |
+
var pager = $(this);
|
1231 |
+
$( pager.children()[index] ).remove();
|
1232 |
+
});
|
1233 |
+
}
|
1234 |
+
});
|
1235 |
+
|
1236 |
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts ) {
|
1237 |
+
var pagers;
|
1238 |
+
|
1239 |
+
if ( opts.pager ) {
|
1240 |
+
pagers = opts.API.getComponent( 'pager' );
|
1241 |
+
pagers.each(function() {
|
1242 |
+
$(this).children().removeClass( opts.pagerActiveClass )
|
1243 |
+
.eq( opts.currSlide ).addClass( opts.pagerActiveClass );
|
1244 |
+
});
|
1245 |
+
}
|
1246 |
+
});
|
1247 |
+
|
1248 |
+
$(document).on( 'cycle-destroyed', function( e, opts ) {
|
1249 |
+
var pager = opts.API.getComponent( 'pager' );
|
1250 |
+
|
1251 |
+
if ( pager ) {
|
1252 |
+
pager.children().off( opts.pagerEvent ); // #202
|
1253 |
+
if ( opts.pagerTemplate )
|
1254 |
+
pager.empty();
|
1255 |
+
}
|
1256 |
+
});
|
1257 |
+
|
1258 |
+
function buildPagerLink( opts, slideOpts, slide ) {
|
1259 |
+
var pagerLink;
|
1260 |
+
var pagers = opts.API.getComponent( 'pager' );
|
1261 |
+
pagers.each(function() {
|
1262 |
+
var pager = $(this);
|
1263 |
+
if ( slideOpts.pagerTemplate ) {
|
1264 |
+
var markup = opts.API.tmpl( slideOpts.pagerTemplate, slideOpts, opts, slide[0] );
|
1265 |
+
pagerLink = $( markup ).appendTo( pager );
|
1266 |
+
}
|
1267 |
+
else {
|
1268 |
+
pagerLink = pager.children().eq( opts.slideCount - 1 );
|
1269 |
+
}
|
1270 |
+
pagerLink.on( opts.pagerEvent, function(e) {
|
1271 |
+
e.preventDefault();
|
1272 |
+
opts.API.page( pager, e.currentTarget);
|
1273 |
+
});
|
1274 |
+
});
|
1275 |
+
}
|
1276 |
+
|
1277 |
+
function page( pager, target ) {
|
1278 |
+
/*jshint validthis:true */
|
1279 |
+
var opts = this.opts();
|
1280 |
+
if ( opts.busy && ! opts.manualTrump )
|
1281 |
+
return;
|
1282 |
+
|
1283 |
+
var index = pager.children().index( target );
|
1284 |
+
var nextSlide = index;
|
1285 |
+
var fwd = opts.currSlide < nextSlide;
|
1286 |
+
if (opts.currSlide == nextSlide) {
|
1287 |
+
return; // no op, clicked pager for the currently displayed slide
|
1288 |
+
}
|
1289 |
+
opts.nextSlide = nextSlide;
|
1290 |
+
opts.API.prepareTx( true, fwd );
|
1291 |
+
opts.API.trigger('cycle-pager-activated', [opts, pager, target ]);
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
})(jQuery);
|
1295 |
+
|
1296 |
+
|
1297 |
+
/*! prevnext plugin for Cycle2; version: 20130709 */
|
1298 |
+
(function($) {
|
1299 |
+
"use strict";
|
1300 |
+
|
1301 |
+
$.extend($.fn.cycle.defaults, {
|
1302 |
+
next: '> .cycle-next',
|
1303 |
+
nextEvent: 'click.cycle',
|
1304 |
+
disabledClass: 'disabled',
|
1305 |
+
prev: '> .cycle-prev',
|
1306 |
+
prevEvent: 'click.cycle',
|
1307 |
+
swipe: false
|
1308 |
+
});
|
1309 |
+
|
1310 |
+
$(document).on( 'cycle-initialized', function( e, opts ) {
|
1311 |
+
opts.API.getComponent( 'next' ).on( opts.nextEvent, function(e) {
|
1312 |
+
e.preventDefault();
|
1313 |
+
opts.API.next();
|
1314 |
+
});
|
1315 |
+
|
1316 |
+
opts.API.getComponent( 'prev' ).on( opts.prevEvent, function(e) {
|
1317 |
+
e.preventDefault();
|
1318 |
+
opts.API.prev();
|
1319 |
+
});
|
1320 |
+
|
1321 |
+
if ( opts.swipe ) {
|
1322 |
+
var nextEvent = opts.swipeVert ? 'swipeUp.cycle' : 'swipeLeft.cycle swipeleft.cycle';
|
1323 |
+
var prevEvent = opts.swipeVert ? 'swipeDown.cycle' : 'swipeRight.cycle swiperight.cycle';
|
1324 |
+
opts.container.on( nextEvent, function(e) {
|
1325 |
+
opts.API.next();
|
1326 |
+
});
|
1327 |
+
opts.container.on( prevEvent, function() {
|
1328 |
+
opts.API.prev();
|
1329 |
+
});
|
1330 |
+
}
|
1331 |
+
});
|
1332 |
+
|
1333 |
+
$(document).on( 'cycle-update-view', function( e, opts, slideOpts, currSlide ) {
|
1334 |
+
if ( opts.allowWrap )
|
1335 |
+
return;
|
1336 |
+
|
1337 |
+
var cls = opts.disabledClass;
|
1338 |
+
var next = opts.API.getComponent( 'next' );
|
1339 |
+
var prev = opts.API.getComponent( 'prev' );
|
1340 |
+
var prevBoundry = opts._prevBoundry || 0;
|
1341 |
+
var nextBoundry = (opts._nextBoundry !== undefined)?opts._nextBoundry:opts.slideCount - 1;
|
1342 |
+
|
1343 |
+
if ( opts.currSlide == nextBoundry )
|
1344 |
+
next.addClass( cls ).prop( 'disabled', true );
|
1345 |
+
else
|
1346 |
+
next.removeClass( cls ).prop( 'disabled', false );
|
1347 |
+
|
1348 |
+
if ( opts.currSlide === prevBoundry )
|
1349 |
+
prev.addClass( cls ).prop( 'disabled', true );
|
1350 |
+
else
|
1351 |
+
prev.removeClass( cls ).prop( 'disabled', false );
|
1352 |
+
});
|
1353 |
+
|
1354 |
+
|
1355 |
+
$(document).on( 'cycle-destroyed', function( e, opts ) {
|
1356 |
+
opts.API.getComponent( 'prev' ).off( opts.nextEvent );
|
1357 |
+
opts.API.getComponent( 'next' ).off( opts.prevEvent );
|
1358 |
+
opts.container.off( 'swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle' );
|
1359 |
+
});
|
1360 |
+
|
1361 |
+
})(jQuery);
|
1362 |
+
|
1363 |
+
/*! progressive loader plugin for Cycle2; version: 20130315 */
|
1364 |
+
(function($) {
|
1365 |
+
"use strict";
|
1366 |
+
|
1367 |
+
$.extend($.fn.cycle.defaults, {
|
1368 |
+
progressive: false
|
1369 |
+
});
|
1370 |
+
|
1371 |
+
$(document).on( 'cycle-pre-initialize', function( e, opts ) {
|
1372 |
+
if ( !opts.progressive )
|
1373 |
+
return;
|
1374 |
+
|
1375 |
+
var API = opts.API;
|
1376 |
+
var nextFn = API.next;
|
1377 |
+
var prevFn = API.prev;
|
1378 |
+
var prepareTxFn = API.prepareTx;
|
1379 |
+
var type = $.type( opts.progressive );
|
1380 |
+
var slides, scriptEl;
|
1381 |
+
|
1382 |
+
if ( type == 'array' ) {
|
1383 |
+
slides = opts.progressive;
|
1384 |
+
}
|
1385 |
+
else if ($.isFunction( opts.progressive ) ) {
|
1386 |
+
slides = opts.progressive( opts );
|
1387 |
+
}
|
1388 |
+
else if ( type == 'string' ) {
|
1389 |
+
scriptEl = $( opts.progressive );
|
1390 |
+
slides = $.trim( scriptEl.html() );
|
1391 |
+
if ( !slides )
|
1392 |
+
return;
|
1393 |
+
// is it json array?
|
1394 |
+
if ( /^(\[)/.test( slides ) ) {
|
1395 |
+
try {
|
1396 |
+
slides = $.parseJSON( slides );
|
1397 |
+
}
|
1398 |
+
catch(err) {
|
1399 |
+
API.log( 'error parsing progressive slides', err );
|
1400 |
+
return;
|
1401 |
+
}
|
1402 |
+
}
|
1403 |
+
else {
|
1404 |
+
// plain text, split on delimeter
|
1405 |
+
slides = slides.split( new RegExp( scriptEl.data('cycle-split') || '\n') );
|
1406 |
+
|
1407 |
+
// #95; look for empty slide
|
1408 |
+
if ( ! slides[ slides.length - 1 ] )
|
1409 |
+
slides.pop();
|
1410 |
+
}
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
|
1414 |
+
|
1415 |
+
if ( prepareTxFn ) {
|
1416 |
+
API.prepareTx = function( manual, fwd ) {
|
1417 |
+
var index, slide;
|
1418 |
+
|
1419 |
+
if ( manual || slides.length === 0 ) {
|
1420 |
+
prepareTxFn.apply( opts.API, [ manual, fwd ] );
|
1421 |
+
return;
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
if ( fwd && opts.currSlide == ( opts.slideCount-1) ) {
|
1425 |
+
slide = slides[ 0 ];
|
1426 |
+
slides = slides.slice( 1 );
|
1427 |
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
1428 |
+
setTimeout(function() {
|
1429 |
+
opts.API.advanceSlide( 1 );
|
1430 |
+
},50);
|
1431 |
+
});
|
1432 |
+
opts.API.add( slide );
|
1433 |
+
}
|
1434 |
+
else if ( !fwd && opts.currSlide === 0 ) {
|
1435 |
+
index = slides.length-1;
|
1436 |
+
slide = slides[ index ];
|
1437 |
+
slides = slides.slice( 0, index );
|
1438 |
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
1439 |
+
setTimeout(function() {
|
1440 |
+
opts.currSlide = 1;
|
1441 |
+
opts.API.advanceSlide( -1 );
|
1442 |
+
},50);
|
1443 |
+
});
|
1444 |
+
opts.API.add( slide, true );
|
1445 |
+
}
|
1446 |
+
else {
|
1447 |
+
prepareTxFn.apply( opts.API, [ manual, fwd ] );
|
1448 |
+
}
|
1449 |
+
};
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
if ( nextFn ) {
|
1453 |
+
API.next = function() {
|
1454 |
+
var opts = this.opts();
|
1455 |
+
if ( slides.length && opts.currSlide == ( opts.slideCount - 1 ) ) {
|
1456 |
+
var slide = slides[ 0 ];
|
1457 |
+
slides = slides.slice( 1 );
|
1458 |
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
1459 |
+
nextFn.apply( opts.API );
|
1460 |
+
opts.container.removeClass('cycle-loading');
|
1461 |
+
});
|
1462 |
+
opts.container.addClass('cycle-loading');
|
1463 |
+
opts.API.add( slide );
|
1464 |
+
}
|
1465 |
+
else {
|
1466 |
+
nextFn.apply( opts.API );
|
1467 |
+
}
|
1468 |
+
};
|
1469 |
+
}
|
1470 |
+
|
1471 |
+
if ( prevFn ) {
|
1472 |
+
API.prev = function() {
|
1473 |
+
var opts = this.opts();
|
1474 |
+
if ( slides.length && opts.currSlide === 0 ) {
|
1475 |
+
var index = slides.length-1;
|
1476 |
+
var slide = slides[ index ];
|
1477 |
+
slides = slides.slice( 0, index );
|
1478 |
+
opts.container.one('cycle-slide-added', function(e, opts ) {
|
1479 |
+
opts.currSlide = 1;
|
1480 |
+
opts.API.advanceSlide( -1 );
|
1481 |
+
opts.container.removeClass('cycle-loading');
|
1482 |
+
});
|
1483 |
+
opts.container.addClass('cycle-loading');
|
1484 |
+
opts.API.add( slide, true );
|
1485 |
+
}
|
1486 |
+
else {
|
1487 |
+
prevFn.apply( opts.API );
|
1488 |
+
}
|
1489 |
+
};
|
1490 |
+
}
|
1491 |
+
});
|
1492 |
+
|
1493 |
+
})(jQuery);
|
1494 |
+
|
1495 |
+
/*! tmpl plugin for Cycle2; version: 20121227 */
|
1496 |
+
(function($) {
|
1497 |
+
"use strict";
|
1498 |
+
|
1499 |
+
$.extend($.fn.cycle.defaults, {
|
1500 |
+
tmplRegex: '{{((.)?.*?)}}'
|
1501 |
+
});
|
1502 |
+
|
1503 |
+
$.extend($.fn.cycle.API, {
|
1504 |
+
tmpl: function( str, opts /*, ... */) {
|
1505 |
+
var regex = new RegExp( opts.tmplRegex || $.fn.cycle.defaults.tmplRegex, 'g' );
|
1506 |
+
var args = $.makeArray( arguments );
|
1507 |
+
args.shift();
|
1508 |
+
return str.replace(regex, function(_, str) {
|
1509 |
+
var i, j, obj, prop, names = str.split('.');
|
1510 |
+
for (i=0; i < args.length; i++) {
|
1511 |
+
obj = args[i];
|
1512 |
+
if ( ! obj )
|
1513 |
+
continue;
|
1514 |
+
if (names.length > 1) {
|
1515 |
+
prop = obj;
|
1516 |
+
for (j=0; j < names.length; j++) {
|
1517 |
+
obj = prop;
|
1518 |
+
prop = prop[ names[j] ] || str;
|
1519 |
+
}
|
1520 |
+
} else {
|
1521 |
+
prop = obj[str];
|
1522 |
+
}
|
1523 |
+
|
1524 |
+
if ($.isFunction(prop))
|
1525 |
+
return prop.apply(obj, args);
|
1526 |
+
if (prop !== undefined && prop !== null && prop != str)
|
1527 |
+
return prop;
|
1528 |
+
}
|
1529 |
+
return str;
|
1530 |
+
});
|
1531 |
+
}
|
1532 |
+
});
|
1533 |
+
|
1534 |
+
})(jQuery);
|
logo-slider.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
/*
|
3 |
Plugin Name: Logo Slider
|
4 |
Plugin URI: http://www.wordpress.org/extend/plugins/logo-slider
|
5 |
-
Description: Add a logo slideshow carousel to your site quicky and easily.
|
6 |
-
Version: 1.4.
|
7 |
-
Author: Enigma
|
8 |
-
Author URI: http://www.
|
9 |
*/
|
10 |
|
11 |
|
@@ -21,7 +21,7 @@ error_reporting(0);
|
|
21 |
|
22 |
// Localization / Internationalization
|
23 |
load_plugin_textdomain( 'lgs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
24 |
-
|
25 |
// define our defaults (filterable)
|
26 |
$wp_logo_defaults = apply_filters('wp_logo_defaults', array(
|
27 |
|
@@ -273,7 +273,7 @@ function wp_logo_images_admin() { ?>
|
|
273 |
<p style="border:2px solid #999; border-radius: 10px; font-size: 12px; padding: 6px 10px; width: 24%;">
|
274 |
<strong>Note: </strong>Drag & Drop is auto save.
|
275 |
</p>
|
276 |
-
|
277 |
<?php if(!empty($wp_logo_slider_images)) : ?>
|
278 |
<table class="widefat fixed" cellspacing="0" id="image_sort" style="width:100%; table-layout:inherit;">
|
279 |
<thead>
|
@@ -335,18 +335,18 @@ wp_enqueue_script('jquery-ui-sortable');
|
|
335 |
<script type="text/javascript">
|
336 |
|
337 |
jQuery(document).ready( function(e) {
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
});
|
351 |
|
352 |
</script>
|
@@ -555,7 +555,7 @@ function logo_slider($args = array(), $content = null) {
|
|
555 |
if( $iPod || $iPhone ){
|
556 |
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
557 |
}else if($iPad){
|
558 |
-
$data_chunks = array_chunk($wp_logo_slider_images, $
|
559 |
}else if($Android){
|
560 |
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
561 |
}else if($webOS){
|
@@ -570,25 +570,52 @@ function logo_slider($args = array(), $content = null) {
|
|
570 |
$data_chunks = array_chunk($wp_logo_slider_images, $num_img);
|
571 |
}
|
572 |
|
573 |
-
|
574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
foreach ($data_chunks as $data_chunk) {
|
577 |
echo '<li class="slide">';
|
|
|
578 |
foreach($data_chunk as $data) {
|
579 |
if($data['image_links_to'])
|
580 |
echo '<a href="'.$data['image_links_to'].'" '.$new_window.'>';
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
}
|
|
|
585 |
echo '</li>';
|
586 |
}
|
587 |
-
|
588 |
-
|
589 |
-
|
|
|
|
|
590 |
echo '</div>';
|
591 |
-
|
592 |
}
|
593 |
|
594 |
// create the shortcode [wp_LogoSlider]
|
@@ -606,62 +633,13 @@ function wp_slider_shortcode($atts) {
|
|
606 |
|
607 |
add_action('wp_print_scripts', 'wp_LogoSlider_scripts');
|
608 |
function wp_LogoSlider_scripts() {
|
609 |
-
|
610 |
-
wp_enqueue_script('cycle', WP_CONTENT_URL.'/plugins/logo-slider/jquery.cycle.all.min.js', array('jquery'), '', true);
|
611 |
-
}
|
612 |
-
|
613 |
-
add_action('wp_footer', 'wp_slider_args', 15);
|
614 |
-
function wp_slider_args() {
|
615 |
-
global $wp_logo_slider_settings; ?>
|
616 |
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
if($wp_logo_slider_settings['arrow'] == '0')
|
623 |
-
{
|
624 |
-
echo '';
|
625 |
-
}
|
626 |
-
else
|
627 |
-
{
|
628 |
-
?>
|
629 |
-
.before('<div class="slider-controls"><a href="#" id="prev"><</a> <a href="#" id="next">></a></div>')
|
630 |
-
<?php
|
631 |
-
}
|
632 |
-
?>
|
633 |
-
.cycle({
|
634 |
-
timeout: <?php if($wp_logo_slider_settings['auto_slide'] == 1) {echo $wp_logo_slider_settings['auto_slide_time'] * 1000;} else { echo 0;} ?>,
|
635 |
-
<?php
|
636 |
-
$slid = $wp_logo_slider_settings['select_slider'];
|
637 |
-
|
638 |
-
if($slid == 'slide')
|
639 |
-
{
|
640 |
-
?>
|
641 |
-
fx: 'scrollHorz',
|
642 |
-
<?php
|
643 |
-
}
|
644 |
-
else if($slid == 'fade')
|
645 |
-
{
|
646 |
-
?>
|
647 |
-
fx: 'fade',
|
648 |
-
<?php
|
649 |
-
}
|
650 |
-
else
|
651 |
-
{
|
652 |
-
?>
|
653 |
-
fx: 'scrollHorz',
|
654 |
-
<?php
|
655 |
-
}
|
656 |
-
?>
|
657 |
-
next: '#prev',
|
658 |
-
prev: '#next',
|
659 |
-
});
|
660 |
-
});
|
661 |
-
</script>
|
662 |
-
|
663 |
-
|
664 |
-
<?php }
|
665 |
|
666 |
add_action( 'wp_head', 'wp_logo_slider_style' );
|
667 |
function wp_logo_slider_style() {
|
@@ -678,7 +656,7 @@ function wp_logo_slider_style() {
|
|
678 |
|
679 |
}
|
680 |
.slider-controls{
|
681 |
-
position:
|
682 |
width:<?php echo $wp_logo_slider_settings['slider_width']; ?>px;
|
683 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px !important;
|
684 |
}
|
@@ -690,6 +668,7 @@ function wp_logo_slider_style() {
|
|
690 |
overflow: hidden;
|
691 |
list-style:none;
|
692 |
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
|
|
693 |
}
|
694 |
.slide{
|
695 |
list-style:none;
|
@@ -726,7 +705,7 @@ function wp_logo_slider_style() {
|
|
726 |
left:42px;
|
727 |
}
|
728 |
.slider-controls {
|
729 |
-
position:
|
730 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
731 |
left:30px;
|
732 |
width: 100% !important;
|
@@ -762,7 +741,7 @@ function wp_logo_slider_style() {
|
|
762 |
left:55px !important;
|
763 |
}
|
764 |
.slider-controls {
|
765 |
-
position:
|
766 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
767 |
width: 100% !important;
|
768 |
}
|
@@ -788,7 +767,7 @@ function wp_logo_slider_style() {
|
|
788 |
width:50% !important;
|
789 |
}
|
790 |
.slider-controls {
|
791 |
-
position:
|
792 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
793 |
width: 100% !important;
|
794 |
}
|
@@ -815,7 +794,7 @@ function wp_logo_slider_style() {
|
|
815 |
left:34px !important
|
816 |
}
|
817 |
.slider-controls {
|
818 |
-
position:
|
819 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
820 |
width: 100% !important;
|
821 |
}
|
@@ -842,7 +821,7 @@ function wp_logo_slider_style() {
|
|
842 |
left:34px !important
|
843 |
}
|
844 |
.slider-controls {
|
845 |
-
position:
|
846 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
847 |
width: 100% !important;
|
848 |
}
|
@@ -870,7 +849,7 @@ function wp_logo_slider_style() {
|
|
870 |
left:34px !important
|
871 |
}
|
872 |
.slider-controls {
|
873 |
-
position:
|
874 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
875 |
width: 100% !important;
|
876 |
}
|
2 |
/*
|
3 |
Plugin Name: Logo Slider
|
4 |
Plugin URI: http://www.wordpress.org/extend/plugins/logo-slider
|
5 |
+
Description: Add a logo slideshow carousel to your site quicky and easily.
|
6 |
+
Version: 1.4.4
|
7 |
+
Author: Enigma Plugins
|
8 |
+
Author URI: http://www.enigmaplugins.com
|
9 |
*/
|
10 |
|
11 |
|
21 |
|
22 |
// Localization / Internationalization
|
23 |
load_plugin_textdomain( 'lgs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
24 |
+
|
25 |
// define our defaults (filterable)
|
26 |
$wp_logo_defaults = apply_filters('wp_logo_defaults', array(
|
27 |
|
273 |
<p style="border:2px solid #999; border-radius: 10px; font-size: 12px; padding: 6px 10px; width: 24%;">
|
274 |
<strong>Note: </strong>Drag & Drop is auto save.
|
275 |
</p>
|
276 |
+
|
277 |
<?php if(!empty($wp_logo_slider_images)) : ?>
|
278 |
<table class="widefat fixed" cellspacing="0" id="image_sort" style="width:100%; table-layout:inherit;">
|
279 |
<thead>
|
335 |
<script type="text/javascript">
|
336 |
|
337 |
jQuery(document).ready( function(e) {
|
338 |
+
jQuery('#image_sort').sortable({
|
339 |
+
items: '.list_item',
|
340 |
+
opacity: 0.5,
|
341 |
+
cursor: 'pointer',
|
342 |
+
axis: 'y',
|
343 |
+
update: function() {
|
344 |
+
var ordr = jQuery(this).sortable('serialize') + '&action=list_update_order';
|
345 |
+
jQuery.post(ajaxurl, ordr, function(response){
|
346 |
+
//alert(response);
|
347 |
+
});
|
348 |
+
}
|
349 |
+
});
|
350 |
});
|
351 |
|
352 |
</script>
|
555 |
if( $iPod || $iPhone ){
|
556 |
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
557 |
}else if($iPad){
|
558 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num4);
|
559 |
}else if($Android){
|
560 |
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
561 |
}else if($webOS){
|
570 |
$data_chunks = array_chunk($wp_logo_slider_images, $num_img);
|
571 |
}
|
572 |
|
573 |
+
$slid = $wp_logo_slider_settings['select_slider'];
|
574 |
+
$lgs_slide_effect = '';
|
575 |
+
|
576 |
+
if($slid == 'slide'){
|
577 |
+
$lgs_slide_effect = 'scrollHorz';
|
578 |
+
}
|
579 |
+
elseif($slid == 'fade'){
|
580 |
+
$lgs_slide_effect = 'fade';
|
581 |
+
}
|
582 |
+
else{
|
583 |
+
$lgs_slide_effect = 'scrollHorz';
|
584 |
+
}
|
585 |
|
586 |
+
$lgs_auto_slide = $wp_logo_slider_settings['auto_slide'];
|
587 |
+
$lgs_slide_time = $wp_logo_slider_settings['auto_slide_time'];
|
588 |
+
|
589 |
+
// Logo Image Slider
|
590 |
+
?>
|
591 |
+
<ul id="logo-slider" class="cycle-slideshow"
|
592 |
+
data-cycle-fx="<?php echo $lgs_slide_effect ?>"
|
593 |
+
data-cycle-timeout="<?php echo (($lgs_auto_slide == 1 ) ? $lgs_slide_time * 1000 : 0) ?>"
|
594 |
+
data-cycle-next="#prev"
|
595 |
+
data-cycle-prev="#next"
|
596 |
+
data-cycle-speed="600"
|
597 |
+
data-cycle-slides="> li"
|
598 |
+
>
|
599 |
+
<?php
|
600 |
foreach ($data_chunks as $data_chunk) {
|
601 |
echo '<li class="slide">';
|
602 |
+
|
603 |
foreach($data_chunk as $data) {
|
604 |
if($data['image_links_to'])
|
605 |
echo '<a href="'.$data['image_links_to'].'" '.$new_window.'>';
|
606 |
+
echo '<img src="'.$data['file_url'].'" class="logo-img" alt="" />';
|
607 |
+
if($data['image_links_to'])
|
608 |
+
echo '</a>';
|
609 |
}
|
610 |
+
|
611 |
echo '</li>';
|
612 |
}
|
613 |
+
?>
|
614 |
+
</ul>
|
615 |
+
<?php
|
616 |
+
echo '<div class="slider-controls"><a href="#" id="prev"><</a> <a href="#" id="next">></a></div>';
|
617 |
+
|
618 |
echo '</div>';
|
|
|
619 |
}
|
620 |
|
621 |
// create the shortcode [wp_LogoSlider]
|
633 |
|
634 |
add_action('wp_print_scripts', 'wp_LogoSlider_scripts');
|
635 |
function wp_LogoSlider_scripts() {
|
636 |
+
$link = dirname(__DIR__).'/wp-catalogue-pro/includes/js/jquery.cycle2.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
|
638 |
+
if(!file_exists($link)){
|
639 |
+
if(!is_admin())
|
640 |
+
wp_enqueue_script('cycle', WP_CONTENT_URL.'/plugins/logo-slider/lgs_jquery.cycle2.js', array('jquery'), '', true);
|
641 |
+
}
|
642 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
|
644 |
add_action( 'wp_head', 'wp_logo_slider_style' );
|
645 |
function wp_logo_slider_style() {
|
656 |
|
657 |
}
|
658 |
.slider-controls{
|
659 |
+
position:absolute;
|
660 |
width:<?php echo $wp_logo_slider_settings['slider_width']; ?>px;
|
661 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px !important;
|
662 |
}
|
668 |
overflow: hidden;
|
669 |
list-style:none;
|
670 |
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
671 |
+
text-align:center;
|
672 |
}
|
673 |
.slide{
|
674 |
list-style:none;
|
705 |
left:42px;
|
706 |
}
|
707 |
.slider-controls {
|
708 |
+
position: absolute;
|
709 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
710 |
left:30px;
|
711 |
width: 100% !important;
|
741 |
left:55px !important;
|
742 |
}
|
743 |
.slider-controls {
|
744 |
+
position: absolute;
|
745 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
746 |
width: 100% !important;
|
747 |
}
|
767 |
width:50% !important;
|
768 |
}
|
769 |
.slider-controls {
|
770 |
+
position: absolute;
|
771 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
772 |
width: 100% !important;
|
773 |
}
|
794 |
left:34px !important
|
795 |
}
|
796 |
.slider-controls {
|
797 |
+
position: absolute;
|
798 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
799 |
width: 100% !important;
|
800 |
}
|
821 |
left:34px !important
|
822 |
}
|
823 |
.slider-controls {
|
824 |
+
position: absolute;
|
825 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
826 |
width: 100% !important;
|
827 |
}
|
849 |
left:34px !important
|
850 |
}
|
851 |
.slider-controls {
|
852 |
+
position: absolute;
|
853 |
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
854 |
width: 100% !important;
|
855 |
}
|
readme.txt
CHANGED
@@ -3,10 +3,9 @@ Contributors: EnigmaWeb
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CEJ9HFWJ94BG4
|
4 |
Tags: logo slide, logo slideshow, logo slide show, logo carousel, image carousel, logo slider, sponsors, logo showcase
|
5 |
Requires at least: 3.1
|
6 |
-
Tested up to:
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Showcase logos in stylish slideshow carousel.
|
12 |
|
@@ -30,6 +29,15 @@ Perfect for displaying a list of sponsor or client logos.
|
|
30 |
|
31 |
[Click here](http://demo.enigmaweb.com.au/logo-slider/) to see Logo Slider in action.
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
== Installation ==
|
34 |
|
35 |
1. Upload the `logo-slider` folder to the `/wp-content/plugins/` directory
|
@@ -47,6 +55,10 @@ Just place the shortcode into a text widget. If that doesn't work (it just rende
|
|
47 |
|
48 |
Add this code above to fuctions.php between the `<?php` and `?>` tags. A good place would be either at the very top or the very bottom of the file. Once you've done this you should be able to use shortcode in widgets now.
|
49 |
|
|
|
|
|
|
|
|
|
50 |
= How can I customise the design? =
|
51 |
|
52 |
You can do some basic presentation adjustments via Logo Slider tab on the admin menu. Beyond this, you can completely customise the design using CSS in the Custom CSS field on settings screen.
|
@@ -66,6 +78,15 @@ If you've tried all the obvious stuff and it's still not working please request
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 1.4.2 =
|
70 |
* Fix for IE 11
|
71 |
* Added option for 1 or 2 images per slide (so 3 is no longer lowest option)
|
@@ -95,6 +116,15 @@ If you've tried all the obvious stuff and it's still not working please request
|
|
95 |
|
96 |
== Upgrade Notice ==
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
= 1.4.2 =
|
99 |
* Fix for IE 11
|
100 |
* Added option for 1 or 2 images per slide (so 3 is no longer lowest option)
|
@@ -122,4 +152,6 @@ If you've tried all the obvious stuff and it's still not working please request
|
|
122 |
= 1.0 =
|
123 |
* Initial release
|
124 |
|
|
|
|
|
125 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CEJ9HFWJ94BG4
|
4 |
Tags: logo slide, logo slideshow, logo slide show, logo carousel, image carousel, logo slider, sponsors, logo showcase
|
5 |
Requires at least: 3.1
|
6 |
+
Tested up to: 4.1
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
|
|
9 |
|
10 |
Showcase logos in stylish slideshow carousel.
|
11 |
|
29 |
|
30 |
[Click here](http://demo.enigmaweb.com.au/logo-slider/) to see Logo Slider in action.
|
31 |
|
32 |
+
= Pro vs Free Version =
|
33 |
+
|
34 |
+
This is the Free version of the plugin. [Get Pro Version](http://enigmaplugins.com/plugins/logo-slider-pro/) if you need the following advanced features:
|
35 |
+
|
36 |
+
* Mulitple Slideshows - create as many sliders as you like across your site
|
37 |
+
* Drag n Drop logo manager so you can easily re-order logos
|
38 |
+
* Fully Responsive Design
|
39 |
+
* Use WordPress Media Library for logo images
|
40 |
+
|
41 |
== Installation ==
|
42 |
|
43 |
1. Upload the `logo-slider` folder to the `/wp-content/plugins/` directory
|
55 |
|
56 |
Add this code above to fuctions.php between the `<?php` and `?>` tags. A good place would be either at the very top or the very bottom of the file. Once you've done this you should be able to use shortcode in widgets now.
|
57 |
|
58 |
+
= Can I do multiple slideshows? =
|
59 |
+
|
60 |
+
This Free version just does 1 slider. If you want multiple sliders [get Pro version here](http://enigmaplugins.com/plugins/logo-slider-pro/).
|
61 |
+
|
62 |
= How can I customise the design? =
|
63 |
|
64 |
You can do some basic presentation adjustments via Logo Slider tab on the admin menu. Beyond this, you can completely customise the design using CSS in the Custom CSS field on settings screen.
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 1.4.4 =
|
82 |
+
* Number of logos to be displayed in iPad - Fixed
|
83 |
+
|
84 |
+
= 1.4.3 =
|
85 |
+
* Conflict with other slider plugins - Fixed
|
86 |
+
* Upgrade jQuery.cycle To jQuery.cycle2 - New
|
87 |
+
* conflict with wpc pro - Fixed
|
88 |
+
* Updated 'Size' text and added explanatory note so it is clear it applies to whole slider, not just a single slide
|
89 |
+
|
90 |
= 1.4.2 =
|
91 |
* Fix for IE 11
|
92 |
* Added option for 1 or 2 images per slide (so 3 is no longer lowest option)
|
116 |
|
117 |
== Upgrade Notice ==
|
118 |
|
119 |
+
= 1.4.4 =
|
120 |
+
* Number of logos to be displayed in iPad - Fixed
|
121 |
+
|
122 |
+
= 1.4.3
|
123 |
+
* Conflict with other slider plugins - Fixed
|
124 |
+
* Upgrade jQuery.cycle To jQuery.cycle2 - New
|
125 |
+
* conflict with wpc pro - Fixed
|
126 |
+
* Updated 'Size' text and added explanatory note so it is clear it applies to whole slider, not just a single slide
|
127 |
+
|
128 |
= 1.4.2 =
|
129 |
* Fix for IE 11
|
130 |
* Added option for 1 or 2 images per slide (so 3 is no longer lowest option)
|
152 |
= 1.0 =
|
153 |
* Initial release
|
154 |
|
155 |
+
|
156 |
+
|
157 |
|