def change(event): if event.keyCode == 39: global run if run is None: # start animation animloop(1) else: # stop animation window.cancelAnimationFrame(run) run = None
def cancel_anim(): global run window.cancelAnimationFrame(run) run = None for e in document.select('div.anim_letter'): e.style.transition = 'none' e.style.transform = 'translateY(0px)' if 'odd_letter' in e.attrs['class']: e.text = '2' if 'even_letter' in e.attrs['class']: e.text = '0' timer.set_timeout(show_banner, 300)
def cancel_animation_frame(int_id): window.cancelAnimationFrame(int_id)
def cancel_anim(): global run window.cancelAnimationFrame(run) run = None print('anim is stopped!')