>            function onAfter(currSlideElement, nextSlideElement,
> options, forwardFlag) {
>                 $('#main').html(this.alt);
>           }});
>
> Ideally, in my onAfter callback I would like to have the upcoming
> image's alt text instead of the current one's.  Is this possible?
>
> Thanks!
> ~Amy


Hmm, a bit tricky but this might get the job done:

function onAfter(curr,next,opts,fwd) {
        var $slides = $(this).parent().children();
        var index = $slides.index(this);
        var $nextSlide;
        if (fwd && index == (opts.slideCount - 1))
                $nextSlide = $slides.eq(0);
        else if (fwd)
                $nextSlide = $slides.eq(index+1);
        else if (opts.slideCount == 0)
                $nextSlide = $slides.eq(opts.slideCount-1);
        else
                $nextSlide = $slidex.eq(index-1)

        $('#main').html($nextSlide.attr('alt'));
}

Disclaimer: this won't work if you're using the 'slideExpr' option.

Mike

Reply via email to