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

Assigning CSS value with Javascript in IE4

Status
Not open for further replies.

yandso

Programmer
Joined
Jul 20, 2001
Messages
278
Location
US
Hi all,
I have one of those wonderful version questions.
I have this code working in IE 5.5 using javascript to change the position value on the fly.
<script>
function functionName(){
if(statement){
divName.style.visibility=&quot;hidden&quot;
divName.style.position=&quot;absolute&quot;
}
else{
divName.style.visibility=&quot;visible&quot;
divName.style.position=&quot;relative&quot;
}
}
However when I run this in IE4 it gives me the error that &quot;Object does not support this action&quot;
Does anyone know a way around this. What I am looking for is a way to close the white space when the div is not visible, with out re-positioning the other contents of the page.

Thanks
Roj
 
Probably just doesn't have good enough CSS support - try setting display to none, but this probably won't work in v4.

By setting display to none, then it is not rendered at all by the page, meaning no space is allowed, and even if the divs are at the bottom of the page, no scroll bar shows, because effectively it does not exist.

A hidden element still has room allowed - giving you the whitespace.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top