SetInterval with short time in IE9 not update the SRC, only longer time.

SetInterval with short time in IE9 not update the SRC, only longer time.

Hi all.

I use this code for change the src attribute from img tag in short intervals. So i create an animated sequence images as a movie showed in a div.

This code function perfect in Chrome but in IE9 it function only I change the time loop in SetInterval for 150 or longer times...

Any sugestion?

thanks.

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. <script src="http://code.jquery.com/jquery-latest.js"></script>
  7. </head>
  8. <script>
  9. function teste1(){
  10. var i = 1;
  11. var interval_base1 = setInterval(function base1(){
  12. $("#teste").find('img').attr('src', "transition/"+ i +".jpg");
  13. i+=1
  14. },50)
  15. }

  16. </script>
  17. <body>
  18. <div id="teste" onClick='teste1()'> teste <br> teste <img src="img/avalanche.jpg"> </img> </div>
  19. </body>
  20. </html>