Adding a stop() and a way to do a restart to a FadeIn and FadeOut

Adding a stop() and a way to do a restart to a FadeIn and FadeOut

I am trying to understand Jquery and I have this:

$(function(){
$('.fadein img:gt(0)').hide();
setInterval(function(){
    $('.fadein :first-child')
    .fadeOut(1000)
    .next('img')
    .fadeIn(1000)
    .end()
    .appendTo('.fadein');
    }, 5000);
});

And I would like to stop and restart it.  Is that possible?  Can you point me to a article discussing it?

Many thanks...

Todd
    • Topic Participants

    • todd