Search code examples
javascriptphpjqueryhtmlpreload

Preload tag IMG without specifying the name of the images


I need a script that loads all images of a web page, and then displays it. I would like the script to preload all TAG and then make a web page visible.

I have alrady tried script like JPreloader or a jQuery plugin, but the I want to write in an array the name of the image.jpg and preload all img tags without specifying the name of the images!


Solution

  • In your css

    body {display: none;}
    

    In Script Tag

    $(window).load(function(){
      $(body).show();
    });