making your page invisible then visible

Discussion in 'Javascript' started by Stuart Wexler, Jul 22, 2003.

  1. 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?
     
    Stuart Wexler, Jul 22, 2003
    #1
    1. Advertising

  2. 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/
     
    David Dorward, Jul 22, 2003
    #2
    1. Advertising

  3. Stuart Wexler

    Grant Wagner Guest

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

    * 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
     
    Grant Wagner, Jul 22, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Susan van Houen

    making webcontrols visible/invisible

    Susan van Houen, Jul 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    580
    Anatoly
    Jul 13, 2003
  2. SP
    Replies:
    1
    Views:
    963
  3. Andy B
    Replies:
    5
    Views:
    628
    Andy B
    May 29, 2008
  4. R.G. Vervoort

    making select visible \ invisible

    R.G. Vervoort, Apr 12, 2004, in forum: Javascript
    Replies:
    1
    Views:
    131
    R.G. Vervoort
    Apr 12, 2004
  5. Harry Gould
    Replies:
    4
    Views:
    193
    Harry Gould
    May 28, 2004
Loading...

Share This Page