jquery cycle plugin - #prev and #next cycling through seperated galleries
I found this idea on stackoverflow:
Cycling through several galleries
$(function() {
$
('#slideshow').cycle({
fx
: 'fade',
speed
: 350,
prev
: '#prev',
next: '#next',
timeout
: 0,
after
: onAfter
});
function onAfter(curr,next,opts) {
var caption = (opts.currSlide + 1) + opts.slideCount;
$
('#counter').html(caption);
if(opts.currSlide + 1 == opts.slideCount) {
$
("#next").click(function() { document.location = "galleryB.html"; })
}
if(opts.currSlide + 1 == 1) {
$
("#prev").click(function() { document.location = "galleryD.html"; })
}
}
});
onAfter option for image counter and condition to jump to next gallery when
reaching the final image of current gallery.
#next works fine but #prev doesn't. #prev should jump to the previous gallery
when you are in the first image of current gallery, but instead the condition
is always true. No matter which image is currently viewd, #prev always jump back
to the previous gallery. I tried using 2 conditions (&&) but it doesn't work.
I am also trying to figure out how to start on the last image of a gallery
when cycling backwards through the galleries with #prev.
Thanks for any help in advance.