Stuart said:
Hi,
I have span tag around my form-- which is basically
my entire page-- that sets the display to none. I want
to, after running through some javascript care of the body
onload event, make the entire page visible again. How
do I do that?
<body onload="makeVisible();">
<span id="mySpan" style="position:relative;visibility:hidden;"><!-- HTML
content --></span>
<script type="text/javascript">
function makeVisible() {
var element;
if (document.getElementById) {
// IE 5.5+, NS6+, Opera 6+
element = document.getElementById('mySpan').style;
} else if (document.layers) {
// NS4
element = document.layers['mySpan'];
} else if (document.all) {
// IE < 5.5, Opera 5(?)
element = document.all('mySpan').style;
}
if (element) {
element.visibility = 'visible';
} else {
alert("I hope you're reading this, because if you have
JavaScript off, you will see nothing");
}
}
--
| Grant Wagner <
[email protected]>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
*
http://www.mozilla.org/docs/web-developer/upgrade_2.html