How can I loop an animation continuously in jQuery?

Make it a function and have it call itself as a callback:

$(document).ready(function(){
    scroll();
}

function scroll() {
    $(".boxtext").css("bottom", "-300px");
    $(".boxtext").animate({bottom:"600px"}, 50000, scroll);
}

Keep in mind, this won’t be very fluid.

EDIT: I wasn’t thinking earlier. My mistake.

Leave a Comment