how to make an unfinished loop

how to make an unfinished loop

hello,

i am a beginner with jquery and im wondering how i can make an unfinished loop?

i have some code written and i how can i make a loop which is running all the time since document ready.

for example i would change a background color for #block or slideUp this element. this would be also perfect if i could delay this actions and stop the loop on mouseover but this are the question for the future :)

that is my code:

  1.     $(function() {
  2.         $(document).ready(function(){
  3.             $('#block').delay(5000).slideUp('slow');
  4.             $('#block').css('background', 'red');
  5.             });
  6.         });
thank you for your help. :)