Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ajax request images are flashing

I have a basic ajax request and have it set to 3 seconds for right now. will go higher, but I want to fix the problem that happens everytime the request happens. for some reason every image (stored in the DB - not that many and are thumbnails) they all flash.

Is there a way around the images flashing on the get request?

$(document).ready(function(){
   var ajaxDelay = 3000;
   setInterval(function(){
    $('#timedContainer').load('jquery_timed.php');   
    }, ajaxDelay);
});
like image 677
Jordie Avatar asked Nov 04 '22 15:11

Jordie


1 Answers

As far as I know, you'll have to preload/cache the images before displaying them in order to avoid that flash. Here is another answer on how to do that.

like image 115
tdlm Avatar answered Nov 09 '22 05:11

tdlm