Skip to content

Instantly share code, notes, and snippets.

@alisspers
Created November 13, 2012 11:04
Show Gist options
  • Save alisspers/4065232 to your computer and use it in GitHub Desktop.
Save alisspers/4065232 to your computer and use it in GitHub Desktop.
jQuery Cycle - Anpassa längd och övergångseffekt för varje bild
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