Link to home
Start Free TrialLog in
Avatar of porkVT
porkVT

asked on

Hding content until after load

For a project I am currently working on, we are using dynamic html and javascript to display content based on what menu link the user clicks on.  I've noticed one little nuance though that I would like to fix.

In the body's onload event, we call our javascript function to hide all the content cells except for the welcome page.  The problem is that with network lag, all the content for the page shows up initially until the page is finished loading and the onload event fires, hiding the data we dont want to show.  Is there a way to prevent this?  We would like everything to be hidden initially, and then when the onload fires, we can unhide the welcome page or something to that effect.  Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of cLFlaVA
cLFlaVA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cLFlaVA
cLFlaVA

By the way -- the reference to setTimeout() was an initial idea I had, then abandoned.  Sorry to confuse you :)
Why dont you hide all the elements before and then unhide it as needed by using style = "display: none;"? That would make more sense if you don't want the elements showing up anyway?

AJ
Avatar of Roonaan
<style>
body * {display:none;}
body.loaded * {display:inherit;}
</style>
<body onload="this.className='loaded';">
stuff
</body>

-r-
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

ACCEPT cLFlaVA  -- http://Q_21147802.html#12169317

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

dakyd
EE Cleanup Volunteer