jquery - Ready event that takes place after dom has loaded but before the user can see the dom -


I am using a window or document ready function, that is, in some browsers, the user can see the DOM The page is loading while being manipulated. For example, if I was drawn to prepare an element in the window, then the user can see the image load first, then be removed.

I understand that I can hide everything in the CSS and after that I can show it after executing my code, but in reality it is not the solution I am looking for. And it does not always work for one, because JS is asynchronous, there is no way to know that after the end of all other domain joints, your show's function is going to fire.

Basically what I want is a function that works like a document / window ready, except that before the DOM is visible before the DOM is loaded, but it appears Before - this happens when I want to manipulate me

There is no such event that you Are looking for .

It is called one. A Google search will show you more techniques. However, the most common way with JQuery is to just add your code to style = "display: none" . Afterwards, set your ready event call $ (body) .show () .

At the end, calculate a good point about the height about the comment. If you can support modern browsers, and you need to maintain the height for any reason, then you have to type style = "opacity: 0" and style = "opacity: 1" / Display to hide / hide your content instead of code.

If you need to make sure that all the manipulation is done for the first time. You will then need to manually track all the manipulation and trigger the show , when you will ensure that they are all complete.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -