Fadein/fadeout, fading is slow and fading out img flicks on top in firefox

Discussion in 'JavaScript' started by abrakatabra83, May 8, 2012.

  1. #1
    I am making this site http://bit.ly/JV5I0Z

    I have a fade-in effect, where the 2nd image (newBg) stands on top of the first one (bgImg) and fades in, then i copy the src from the 2nd to the 1st so now they are both the same image, then set the 2nd's opacity to 0 and repeat whenever the user changes image.

    This works fine on opera and chrome, but on firefox the fadein is like too slow, and the fading out img (which doesn't really fade out as i said, just gets overwritten) flicks in the end of the animation, appearing on top and then disappearing.

    Here is the code handling the fade in thing (and the image preloading code at the bottom): http://jsfiddle.net/VbjPc/1/

    Any help is appreciated.
     
    abrakatabra83, May 8, 2012 IP