In a html page I am making, I dynamically move images into the viewport using jQuery and Raphael's library. When I refresh the webpage, these images appears to be white block for <100ms before the webpage loads again. I want to move these images out of the viewport so these white blocks don't appear.
I used window.onbeforeuload=functio(){$('#myimge").css(...);}
to move the image. But it turns out that the white blocks still appear because the browser doesn't have time to show a newly refreshed view with the images in the new location. If I put alert()
, then the images will disappear. So I am looking a way to really move the images out of the browser window before the browser reloads the page.