I’ve been working on this scripts and can’t seem to get any help.
I have it on my fiddle. Basically I have some divs and I wanted them to fade in and fade out which they are doing right now correctly.
However, when content 1 is fading out, content 2 must be coming in at the same time, (I guess the opacity must be lighter) for the smoother transition.
Right now as content 1 fades out, it leaves a white spacing before Content 2 comes in.
JavaScript:
$(function(){
function fadeMyContent() {
$(".thecontent:first").fadeIn(700).delay(1000).fadeOut(700,
function() {
$(this).appendTo($(this).parent());
fadeMyContent();
});
}
fadeMyContent();
});
HTML:
<ul>
<li class='thecontent'> CONTENT 1</li>
<li class='thecontent'> CONTENT 2</li>
<li class='thecontent'> CONTENT 3</li>
<li class='thecontent'> CONTENT 4</li>
<ul>
I’ve got you a solution. I’m using images in my JSFiddle, but they’re only to demonstrate the effect. Fading between black backgrounds is difficult; I suggest you give the
ula black background and fade the text/content above it in and out; it will give a nicer effect.This is the code from the Fiddle. If you need an explanation, please ask.
The images are licensed under blah blah who cares, bring on the lawsuit for me stealing your beach 😉