I have a div thats currently set to display none, The Div has a background image that is approx 5000px wide, 2000px high.
I toggle the div display attirbute with jquery on a button click only with the image being so big the div loads and the image loads 1/2 seconds afterwards; is there a function where I can show a preloader until the image is ready and then display it?
Thanks
Try to use native javascript’s
Imageobject to preload the image.Also consider about to avoid using such huge images on the web by making tiles for example.