0

I've tried using this code Fade background image in and out with jQuery? which is awesome. Would anyone help with a quick adjustment as I'm a complete beginner at jquery.

I would like the same (fading rotating background images). I adjusted the timing in the code so that the rotation was nice and slow (8seconds) but this delays the first image appearing. Is it possible to have the first image appear immediately then have a slow rotation?

Thank you, Amy

UPDATE: Thanks for your help everyone. Here's my fix in case it's useful. Forgive me as I haven't used jsfiddle or stackoverflow before. I found that running the page on a regular browser (outside jsfiddle) there was a delay in loading the first image when I wanted the rotation to be very slow. ie the screen was just black for a long time before the image loads.

I (think I have) fixed this by adding a new image outside the jsquery scripting which loads first before the rotating background starts.

I included the script here - http://jsfiddle.net/aha56/9CHKE/ Which is just a minor adjustment from this one http://jsfiddle.net/RnqQL/109/ which I found here Fade background image in and out with jQuery?

Community
  • 1
  • 1
aha56
  • 1
  • 2
  • post script you're using so its easier to help! – Tom Sep 18 '12 at 08:56
  • Yes it is possible. But SO is not a site where other programmers will do your work. If you have a specific problem, ask for that and you will get help here. – feeela Sep 18 '12 at 08:56
  • Sorry to have offended @feeela still feeling my way around here and I clearly need to learn jquery before asking questions. the code I have been using is this '$('img').hide(); function anim() { $("#wrap img").first().appendTo('#wrap').fadeOut(1000); $("#wrap img").first().fadeIn(1000); setTimeout(anim, 8000); } anim();' I think it's adding a delay on page load. – aha56 Sep 18 '12 at 12:07

2 Answers2

0

Do you need like this ? May be it will help you. Please check the demo

muthu
  • 5,381
  • 2
  • 33
  • 41
0

Instead of delay fade in you need to delay fade out? like this that you want?

$(this).delay(3000 * index).fadeIn().fadeOut(3000);

hope it will help.

piam
  • 653
  • 6
  • 13