Javascript event after dom is ready but not displayed

Is it possible to do something after the dom is ready but not displayed (white screen) I would like to hide the content from the user, and after some operations I would like to show the final image. I can use "display: none" in the body tag, but I'm working on a huge project, so I don't want to change every page. Thanks

+3
source share
4 answers

Here is how?

document.onload = function() {
    //your codes
}

In contrast, window.onloadthis function is launched after loading the DOM, so manipulation is possible, but it does not require the display of all elements.

+2
source

Is it possible to do something after dom is ready but not displayed

DOM , HTML-. , , .

...

"display: none" body, , .

, , , . , .

, , , .


, ( ) . .

+1

if you can use jQuery, this call is called when dom is ready, but the page is not loaded

$(document).ready(function(){

)};
0
source

I will make my 2 cents here.

With jquery, the $ ("document") event. ready () is launched after the DOM is fully loaded (without images, that is) into your browser, but is not displayed. Therefore, I think that in order to achieve what you want, you will need to introduce some handler function inside the ".ready ()" method to handle everything that you want to achieve.

Is this what you were looking for?

0
source

All Articles