Hi,

I am a newbie so bare with me here :)  I am using the jQuery Cycle
Plugin by Mike Alsup (thank you, Mike).  I am using prev and next
buttons to scroll the images, and I want to show the image alt with
it. When the page loads on the first time, the first image is there,
but the alt isn’t. Only when I scroll next or prev I am getting the
alt. This is the code that I am using:

$(function() {

 $('#s1').cycle({

fx:     'scrollHorz',

speed:  'fast',

 timeout: 0,

prevNextClick: onBefore,

next:   '#next2',

prev:   '#prev2'


});



function onBefore(isNext, zeroBasedSlideIndex, slideElement) {

   $('#captionImg').html(slideElement.getElementsByTagName('img')
[0].getAttribute('title') + slideElement.getElementsByTagName('img')
[0].getAttribute('alt'));

}

Thanks!

Mor

Reply via email to