timer - clearTimeout no working But setTimeout is -
i have image wish rotate every 5 seconds or so... have got image rotate once only. there seems nothing wrong coding, no errors , can console log show functions being called , timeout too, still not looping rotation... ideas.. thank you.
<script> function countit(){ var img = document.getelementbyid("weather").style.transitionduration = "3s" var img = document.getelementbyid("weather").style.webkittransform = "rotatey(360deg)"; cleartimeout(inter2); }; </script> <script> function countrev(){ var img = document.getelementbyid("weather").style.transitionduration = "3s" var img = document.getelementbyid("weather").style.webkittransform = "rotatey(0deg)"; cleartimeout(inter); }; </script> <script type="text/javascript"> var inter = (function doit(){ settimeout(countit,1000); })(); var inter2 = (function doit(){ settimeout(countrev,4000); })(); </script> </body> </html>
Comments
Post a Comment