animation - Continually update and replace image with jQuery -


i have image update many times second. want able display updates fast can. have bit of code flickers , isn't good. plus limited updating twice second. want able display faster if possible.

essentially creating crude video using jpeg stills. image files few k max , run locally - not on internet.

i expect need kind of double buffering system unsure how in jquery. i'd need load image in background before switching it. cannot seem able tell when image has loaded.

here code far

<div id="vidcontent">     <img src="" width="255" height="255" id="vidimg" /> </div>  <img src="title.png" id="title" />  <script type="text/javascript">     $(document).ready(function()     {         setinterval('loadimage();', 500 );     });       function loadimage()     {         var img_src = "http://10.1.9.12/web/data/vid_jpg0.jpg";         var img = $("#vidimg");          img.attr('src', img_src+"?_t=" + (new date()).gettime());     }  </script> 

you'll better off using <canvas> - <img> tag isn't designed animation.

have @ the chapter on canvas in dive html5.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -