Hi,

I've just started using jQuery with the cycle plugin for displaying a
slideshow. It works really well and does everything that I need to
apart from one thing.

I have a requirement to be able to change the display duration of each
slide and the transition used for each slide on the fly. Changing the
display duration is done easily enough by setting opts.timeout in a
before callback function. I also thought that in the same function I
would be able to set opts.fx to whatever I wanted but it doesn't seem
to work that way.

Having looked through the cycle plugin code it seems pretty obvious
that the timeout is used each time at the end of the go function but
the transition type is only setup the once in the cycle function. I've
tried replicating the code for initialising the transition by putting
the following in the go function (with globals declared for the
container and slides) but this doesn't work:

// run transition init fn

var init = $.fn.cycle.transitions[opts.fx];

if ($.isFunction(init))

   init($g_cont, $g_slides, opts);

else if (opts.fx != 'custom')

   log('unknown transition: ' + opts.fx);

I've also tried replicating almost all of the cycle function into a
new function taking out the parts that I don't think are necessary and
calling this new function at the top of the go function but again this
didn't work.

I'd be grateful if someone could point me in the right direction on
this and/or explain a bit more about how the transitions are setup so
that I can code in the functionality that I need.

Thanks for your time in advance.

Keith

Reply via email to