Link to home
Start Free TrialLog in
Avatar of maccaj51
maccaj51Flag for Afghanistan

asked on

JQUERY: image fade in and out and getting image title

Hi Experts,

I have this code...

<div class="webcam">
<img src="/webcam1.jpg" title="webcam1"/>
<img src="/webcam2.jpg" title="webcam2"/>
<img src="/webcam3.jpg" title="webcam3"/>
 </div>
<div class="webcam-details"></div>

Using Jquery, how would I fade the images in/out one at a time and display the title tag in webcam details??

Thanks
Avatar of maccaj51
maccaj51
Flag of Afghanistan image

ASKER

ive got this so far:


$(document).ready(function(){
$('.webcam img:gt(0)').hide();
setInterval(function(){$('.webcam :first-child').fadeOut().next('img').fadeIn().end().appendTo('.webcam');}, 3000);
var title = $(".webcam img").attr("title");
  $(".webcam-details").text(title);
});
ASKER CERTIFIED SOLUTION
Avatar of StingRaY
StingRaY
Flag of Thailand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Super!