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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -