Created
November 13, 2012 11:04
-
-
Save alisspers/4065232 to your computer and use it in GitHub Desktop.
jQuery Cycle - Anpassa längd och övergångseffekt för varje bild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $slider = $('#slider'), | |
slideSettings = [ | |
{ timeout: 2000, fx: 'fade' }, | |
{ timeout: 3000, fx: 'scrollHorz' }, | |
{ timeout: 3000, fx: 'scrollVert' }, | |
{ timeout: 6000, fx: 'scrollUp' } | |
], | |
slideTransitions = slideSettings[0].fx; | |
$.each(slideSettings, function(index, settings) | |
{ | |
if (0 == index) | |
{ | |
return; | |
} | |
slideTransitions += ',' + settings.fx; | |
}); | |
$slider.cycle({ | |
fx: slideTransitions, | |
randomizeEffects: false, | |
timeoutFn: function(currElement, nextElement, opts, isForward) | |
{ | |
return slideSettings[opts.currSlide].timeout; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment