0

i have a div that is hidden.After calling a function i just give the code as follows for making the div visible.
the code is document.getElementById("divid").style.display="block";
it works in IE but not in Mozilla(3.0.3)

have any idea?
thanx in advance...

4
Contributors
3
Replies
5
Views
9 Years
Discussion Span
Last Post by Drew
0

If you have a floating elements next to --> document.getElementById ("divid"); just simply add this up -->

document.getElementById ("divid").style.display="block";
document.getElementById ("divid").style.float= "left"; 
/* It's up to you to set things up wheather it's left, right or center floated */
document.getElementById ("divid").style.clear= "both";
0

try using the visibility property.

to make it visible:

document.getElementById ("divid").style.visibility="visible";

to make it back to hidden:

document.getElementById ("divid").style.visibility="hidden";

Regards,
ivanceras

0

Using the "visibility" property only hides the element, but the space it uses will still be taken up and leave a blank gap in the page.

The easiest way to hide/open a DIV is:

<a href="#" onclick="var myBox=document.getElementById('myDiv');myBox.style.display=(myBox.style.display=='none' ? 'block': 'none');return false;">Hide or Show Box</a>

<div id="myDiv">this will open or close</div>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.