0

i'm looking for a script or a way to preload images before the page become full load. What i found are script where i have to write the name and the root of the images, i need something that load like:

Load all img of the page, after show the page, during the loading of the images to show a preload image ( like loading or something like that ).

It's possible?

I have alrady tried the script on the web, but i found just script where i have to put the name of the images in a array... i don't need it!

I want that javascript load before ALL tag ( without i set the name of the images ) of the page and than show the page!

RavenJe
  • 129
  • 4
  • i want that javascript load before ALL tag ( without i set the name of the images ) of the page and than show the page! – RavenJe Mar 16 '15 at 21:49

2 Answers2

0

jquery has a plugin called imageready.

https://github.com/weblinc/jquery-imageready

Ive used it many times, it should work as you expect

Severian
  • 427
  • 3
  • 18
0

Images will start being downloaded by your browser as soon as the DOM renders that part of your HTML. What you need to do is find a suitable animated gif very small size (few kilobytes) of a loading animation. Then have some javascript hide the image you want to show that is still getting downloaded by your browser. By using something like: Javascript callback for knowing when an image is loaded you will be able to check when an image has loaded, and the callback you can hide its associated gif and show the real image.

Community
  • 1
  • 1
davidvelilla
  • 488
  • 5
  • 18
  • in your script i haave to write the name of the images, i want that javascript load before ALL tag ( without i set the name of the images ) of the page and than show the page! – RavenJe Mar 16 '15 at 21:49