Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > making your page invisible then visible

Reply
Thread Tools

making your page invisible then visible

 
 
Stuart Wexler
Guest
Posts: n/a
 
      07-22-2003
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?



 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      07-22-2003
Stuart Wexler wrote:

> I have span tag around my form--


That's invalid, inline elements (span) can not contain block level elements
(form). You probably want a div instead... or apply the JS/CSS to the form
directly.

> 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?


document.getElementById('foo').style.display = 'block';

.... and anyone in a browser which supports CSS but not JS is *&^$%^$ed.

--
David Dorward http://david.us-lot.org/
 
Reply With Quote
 
 
 
 
Grant Wagner
Guest
Posts: n/a
 
      07-22-2003
Stuart Wexler wrote:

> 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 <(E-Mail Removed)>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_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-deve...upgrade_2.html


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making 1 control invisible while showing another in the exact location of the invisible one Andy B ASP .Net 5 05-29-2008 03:08 AM
making a server control visible / invisible in a DataList SP ASP .Net 1 03-01-2006 05:50 PM
Making table rows visible/invisible in Netscape Harry Gould Javascript 4 05-28-2004 07:00 PM
making select visible \ invisible R.G. Vervoort Javascript 1 04-12-2004 07:31 PM
making webcontrols visible/invisible Susan van Houen ASP .Net 1 07-13-2003 01:14 PM



Advertisments