Fixed documentation type mismatch.

Moved requestAnimationFrame call to end of callback function.