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.
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- </head>
- <script>
- function teste1(){
- var i = 1;
- var interval_base1 = setInterval(function base1(){
- $("#teste").find('img').attr('src', "transition/"+ i +".jpg");
- i+=1
- },50)
- }
- </script>
- <body>
- <div id="teste" onClick='teste1()'> teste <br> teste <img src="img/avalanche.jpg"> </img> </div>
- </body>
- </html>