Hi
I am using the jQuery cycle pluging, and having some trouble after i added a play/pause option.
The code looks like this;
$('#img').cycle({
fx: 'fade',
speed: 'slow',
timeout: 1000,
pager: '.imagegallerypager.r2s1',
pagerClick: function (zeroBasedSlideIndex, slideElement) {
$('#txt').cycle({
startingSlide: zeroBasedSlideIndex
});
$('#txt').cycle('pause');
$('#img').cycle('pause');
}
});
$('#txt').cycle({
fx: 'none',
speed: 'slow',
timeout: 1000
});
$('#playpause, .imagegallerypager a').click(function () {
if ($('#playpause').attr('class') == 'pause') {
$('#txt').cycle('pause');
$('#img').cycle('pause');
$('#playpause').html('<img src="images/icon_play.gif" alt="Play" title="Play" />');
$('#playpause').removeClass('pause');
$('#playpause').addClass('play');
}
else if ($(this).attr('class') == 'play') {
$('#txt').cycle('resume');
$('#img').cycle('resume');
$('#playpause').html('<img src="images/icon_pause.gif" alt="Pause" title="Pause" />');
$('#playpause').removeClass('play');
$('#playpause').addClass('pause');
}
});
The script runs fine until i press the pause button and then the play button to start the action again. The img runs fine, but the txt seems to have the settings reset (ie fx effet, timeout effect etc) resulting in the img and txt being ofset and no longer following each other. I have tried many different things, but so far no luck.
Any suggestions?