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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about CSS, Vbscript and HTA's

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
0
0
US
I am creating an HTA using VBscript. I have a few div's that I hide when not in use. The problem is that when the div is hidden it takes up space. so if I have this:
Code:
<div id="divFormOne">
     Some code here
</div>
<div id="divFormTwo">
     Some code here
</div>
document.getElementById("divFormOne").style.visibility = "hidden"
document.getElementById("divFormTwo").style.visibility = "visible"
I show the first div (divFormOne) and hide the other one (divFormTwo). When I reverse it, hide the first div (divFormOne) and show the other div (divFormTwo), the 2nd div is shown farther down the page. I cannot destroy the div's because I might need them again and they are static, not dynamically created. Is there a way with CSS to have the div's when shown go to the same place?

Thanks,
timgerr

-How important does a person have to be before they are considered assassinated instead of just murdered?
Congratulations!
 
Use display instead of visibility. That way the div exists, but takes no space.

style.display = none;

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top