What i am trying to achieve is the captions on an image slider, slide from left to right with animate() and then fadeout as the image changes, then loop once the slider has started it's loop. I've searched these forums for hours trying to find a solution for the loop but i can't seem to get any of them working. Most likely something i am missing as i am only new to learning jquery.
I apologize if this question is a repeat, but i've tried for hours and just cant get it working.
Below is what i have so far:
HTML:
<div class="slidein">
<p class="first"> MATTE</p>
<p class="second">BLACK</p>
<p class="third">BRO </p>
</div>
CSS:
.slidein {
z-index: 10000;
left: -100px;
top: 100px;
position: absolute;}
.first {
background-color:#0C0;
position:relative;}
.second {
background-color:#0C0;
position:relative;}
.third {
width: 35px;
background-color:#0C0;
position:relative;}
jquery:
$(document).ready(function () {
function repeat() {
$(".first").animate({left:'200px'},100);
$(".second").delay(200).animate({left:'200px'},200);
$(".third").delay(300).animate({left:'200px'},300);
$('.slidein').delay(3500).fadeOut(500)({
},500 ,function() {
repeat();
});
}
repeat();
});
Here is a fiddle of it working but not looping once finished,
http://jsfiddle.net/elroyz/L2Ynu/18/