I am having trouble developing how to get a simple fade in a fade cycle to work. I am new to jQuery, as you can tell. I went for it, but now it worked for too long, so I thought I would ask for help.
What I want to do:
I have two images, id # img1 and # img2. I want image 1 to be fadeIn, then wait for it to say that after 6 seconds it will disappear. I tried the .wait function, but it just stopped the work I got from work. I managed to get the first image that will disappear and then come out, but without waiting between them. Then I want to start fading image 2 while image 1 is fading, and then image 2 to wait, then disappear, and image 1 will disappear again and loop forever! Hope this makes sense.
$(document).ready(function(){
$('#img1').hide()
.load(function () {
$(this).fadeIn(4500)
.fadeOut(4500);
$('#img2').hide().wait(9000)
.load(function () {
$(this).fadeIn(4500)
.fadeOut(4500);
});
Cheers, it drives me crazy. Ps you can try to give a little explanation of what is happening in your answer. Thanks
source
share