How to make the preload?

Hello! How to make when you open the website there was a GIF picture for 3 seconds, then disappeared and revealed the content of the site?
July 4th 19 at 22:45
1 answer
July 4th 19 at 22:47
Solution
You can use the ready plugins
https://www.niklausgerber.com/projects/preloadme-a...

And, of course, write your own, too, no one bothers, even for educational purposes.

The main points of implementation -
  • To create the preloader
  • To insert an element right after the preloader
  • To prescribe styles of animation
  • To write the script in $(window).on('load', function() { ... });

For example:
$(window).on('load', function () {
 var pre= $('.preloader');
 var indicator = pre.find('.indicator');
indicator.fadeOut();
pre.delay(350).fadeOut('slow');
});

Find more questions by tags CSSHTMLJavaScriptjQuery