Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable toggle buttons until the page is fully loaded?

Status
Not open for further replies.

plectrum

Programmer
Feb 16, 2004
21
0
0
US
Hi,

I have a cgi to generate a html page which contains three tables in three <div>'s in place, and there're three buttons on the top of the page so that users can toggle among these three div's. Since the first table is small and other two are huge and take time to load, but the toggle buttons are shown there already along with the first small table, so, how to avoid user click on those buttons until the full page is loaded?

thx in advance,

Plectrum
 

There are many ways of achieving this. The easiest 2 ways that spring to mind are:

1. Have the toggle buttons initially hidden (using CSS), and show them when the page has loaded (using the onload event of the body element).

2. Initialise a boolean variable to false, which gets set to true using the onload event of the body element. When the toggle buttons are pressed, if the variable is still false, simply return.

Hope this helps,
Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top