I'm trying to use the jQuery cycle plugin to cycle round different quotes. I would like to have the quotes displayed for different amount of time depending on the length of the quote. To achieve this I get the content mangagement system to output the amount of seconds as a class name such as dur13 would be for 13 seconds.
This is my non-working attempt:
$('.featureFade').cycle({cycleTimeout: 10, after: onCycleAfter});
function onCycleAfter() {
$('.featureFade').cycle('pause');
var duration = $(this).attr('class').substring($(this).attr('class').indexOf('dur')+3)
setTimeout(oncycleEnd, duration * 1000);
}
function oncycleEnd() {
$('.featureFade').cycle('resume');
}
Is this possible with cycle? If not is there another plugin that would work? I don't really need fancy effects, just fade in fade out would be enough.
Many thanks