I have a php class that generates a map image depending on my db data. It is periodically updated through the serInterval loop.
I am trying to update it without flickering, but I just can't. I tried different methods (preloader, imageswitcher) without success.
//first load function map() { $("#map").html("<img src=map.php?randval="+Math.random()+">"); } //update it from setInterval calls function updatemap() { $("#map").fadeOut(function() { $(this).load(function() { $(this).fadeIn(); }); $(this).attr("src", "map.php?randval="+Math.random()); }) }
Is there a way to refresh the image without any flicker? I would prefer an intermediate exchange instead of fading.
The problem I ran into is that after calling updatemap (), the image just disappears. ¿Maybe this is a problem with the src attribute? Am I understanding?
Thanks for the help.
source share