Swapping setTimeout to setinterval, Can anyone help me solve this issue
09:21 02 Jun 2013

I'm currently in the middle of building test web sites to help me understand coding more and try and get a better grasp of how it all comes together.

My problem is this - I have a section of the site with a number of quotes, they fade in then slide up out of view revealing a new quote. This is were is I have made the mistake. I have it set perfectly so that it will cycle through all the quotes...but then stop. I would love them to repeat. I know my mistake is using the .setTimeout function instead of the setInterval code.

My question is this, is there an easy solution to swapping the code, its taken me a good while just to wrap my head around this.

Here is the code for you to look at. Any help would be greatly appreciated.

$(function(){
setTimeout(function()
    {
    $("#jobs_1").slideUp(800);
    }, 4000); 
});
$(function(){
setTimeout(function()
    {
    $("#jobs_2").fadeIn(400);
    }, 4800); 
}); 
$(function(){
setTimeout(function()
    {
    $("#jobs_2").slideUp(800);
    }, 8000); 
});
$(function(){
setTimeout(function()
    {
    $("#jobs_3").fadeIn(400);
    }, 8800); 
});     
$(function(){
setTimeout(function()
    {
    $("#jobs_3").slideUp(800);
    }, 12000); 
});
$(function(){
setTimeout(function()
    {
    $("#jobs_4").fadeIn(400);
    }, 12800); 
});
$(function(){
setTimeout(function()
    {
    $("#jobs_4").slideUp(800);
    }, 16000); 
});
$(function(){
setTimeout(function()
    {
    $("#jobs_1").fadeIn(400);
    }, 16800); 
    

});     

  
javascript html css