so I have this issue , I have web site which has a preloader , the preloader disappears when windows.onload function is executed but I don't need this function to wait for the images because there are to many images at the first page which is needed and can't be deleted or compressed anymore.
as well as some css and js files which will take while to be downloaded and it's a good idea to have preloader for them until they are fully loaded (it is really ugly without those files) anyway windows.onload function will wait for the images and document.ready function is only for DOM files not the css and js only the HTML.
any way to solve this issue ???
Asked
Active
Viewed 419 times
0

Babak Kamali
- 59
- 4
-
http://stackoverflow.com/a/13270422/4248328 – Alive to die - Anant May 09 '17 at 11:52
1 Answers
1
You can use some lazy loader plugin and then wait for window.onload
. Basically the lazy loading plugins for images work by specifying the original image url in some custom attribute instead of in src
attribute.
You may have a single placeholder image for all these images, so it won't take time because there are not too many images to load.

Mohit Bhardwaj
- 9,650
- 3
- 37
- 64