Page is refreshed every 5 seconds. Images that received from .php file are appended to some <li > elements.
Here is the code:
function reloadImages(){
for ( i = 0; i < ImgNum; i++) {
var ts = Math.round((new Date()).getTime() / 1000);
$('li#' + i).html('<img src="img.php?session=<?php echo $session; ?>&img=' + i + '&time='+ ts +' " />')
}
}
Everything works as expected. But when reloadImages() is called, Images are flickering during the reload.
How to prevent this flicker? Preload Images?
Help me address the flickering.
you could use the folowing mechanism of preload and callback (is’n tested actually)