Thanks for the suggestions. With some rewriting and changes in the
flow, I was able to get it to work. Although I was able to get it to
work, I wanted to ask one clarifying question to make sure I am
understanding the limits of jQuery methods.

In my original code, I wanted to make three things happen in
sequential order:
1) FadeIn an image
2) Change the CSS background-image
3) FadeOut an image

I believe that that flow won't work since the jQuery CSS method
doesn't include the ability to register a callback. Without a callback
on the CSS method, there is no way to "queue up" the FadeOut to start
after the CSS method has completed. Am I correct in this?

Steve

On Mar 24, 12:26 pm, ripple <[EMAIL PROTECTED]> wrote:
> Here's a good working example. This might help, but of course you will have 
> to tweak the timing to suit your needs.
>
>  http://2whoa.com/dominate/2008/03/jquery-fades.php
>
> Steve Reichgut <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I have been trying to use jQuery to create a relatively simple image
> rotator. The challenge I ran into with this script is that I want the
> new image to fade-in over top of the existing image. After many
> different attempts, I was able to get "pretty close" by using the
> following (unelegant) code:
> i++;
> bg++;
> if (i == (numImages + 1)) { i = i - numImages; }
> if (bg == (numImages +1 )) { bg = bg - numImages; }
> bgImg = "url(/images/stories/js_images_home/header_" + bg + ".jpg)";
> img = 'header_'%20+%20i%20+%20'.jpg">';
> $
> ('#header_gallery').css("backgroundImage",bgImg).html(img).find('img:eq(0)').fadeIn(3000).fadeTo(3000,1).fadeOut(4000,runHomePg);
>
> When I run the code, it works partially. From what I can tell, I am
> doing something wrong in trying to queue the effects . Right now,
> setting the CSS background-image and the fading in & out of the
> foreground image happen simultaneously instead of sequentially like I
> want them to.
>
> Any help would be greatly appreciated...
>
> Steve
>
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it 
> now.

Reply via email to