Add JavaScript methods for animations