Code has been added to clipboard!

Continuous JavaScript Animation

Example
var id = setInterval(frame, 6);

function frame() {
    if (/* test */) {
        clearInterval(id);
    } else {
        /* element style changes */  
    }
}