I want to hide an specific div class while page is loading. The structure is..
<div id ="container">
<div class="project-item tv"></div>
<div class="project-item radio"></div>
<div class="project-item radio"></div>
<div class="project-item tv"></div>
</div>
For example, I want to hide DIV with class radio while page is loading, then show them again after load. Thanks.
CSS:
HTML:
JQUERY:
Use CSS
hide div using css
js
Show div with class radio on DOM ready
Show div with class radio on load
Read What is the difference between $(window).load and $(document).ready?
in JS
First, set it's CSS value to
display:none
Then, in a Javascript file, the jQuery solution would be to use:
$(document).ready()
makes sure that the entire DOM is loaded before the code inside the function is executed