I’m designing a small portfolio website for my friend and I am having difficulty trying to get the fadeIn + fadeOut effect to work properly. The images are sliding + fading, however, there is a long delay in between the fades and you can momentarily see the background. The slider I am using is based off of the following tutorial:
http://www.sohtanaka.com/web-design/automatic-image-slider-w-css-jquery/
The only changes I have done to the original code is to add a caption to the images and (trying to add) a fade effect when the images slide.
Javascript
$(".image_reel").fadeIn(500).delay(0).fadeOut(500);
$(".image_reel").animate({
left: -image_reelPosition
}, 500);
$(".image_reel").delay(0).fadeIn(500);
The code here can be found in the rotate function on the tutorial website.
So, as I stated above the code here is successfully fading and sliding the images, however, there is a delay where you can momentarily see the background.
Any help would greatly be appreciating as to how I can get one image to fade out while the other image is fading in at the same time.
what i’ve done in the past is have two div’s that overlap, and alternate fadein/fadeout, dynamically loading the next image in the div that is currently invisible.
Here is the code i used to accomplish it:
Note that there is a bit more required to make this work as is. The main part of interest to you would be updateImage()