image - JavaScript - How do I stop a script from running onClick()? -
image - JavaScript - How do I stop a script from running onClick()? -
i'm trying figure out how stop script running , rotating images onclick().
any help? please?
thanks, in advance!
document.queryselector('#imagegallery').addeventlistener('click', function () { cleartimeout(thetimer); });
this stop images. if want able toggle stopping , animating, can maintain track of stop/resume state using dataset (at least, suggest way) , phone call numb when resuming state start timeout 1 time again.
this not 100% cross-browser compatible. you'll have utilize attachevent ie, , shouldn't utilize thetimer global variable, declare var.
javascript image onclick gallery
Comments
Post a Comment