making your page invisible then visible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stuart Wexler

    making your page invisible then visible

    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?



  • David Dorward

    #2
    Re: making your page invisible then visible

    Stuart Wexler wrote:
    [color=blue]
    > I have span tag around my form--[/color]

    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.
    [color=blue]
    > 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?[/color]

    document.getEle mentById('foo') .style.display = 'block';

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

    --
    David Dorward http://david.us-lot.org/

    Comment

    • Grant Wagner

      #3
      Re: making your page invisible then visible

      Stuart Wexler wrote:
      [color=blue]
      > 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?[/color]

      <body onload="makeVis ible();">
      <span id="mySpan" style="position :relative;visib ility:hidden;"> <!-- HTML
      content --></span>
      <script type="text/javascript">
      function makeVisible() {
      var element;
      if (document.getEl ementById) {
      // IE 5.5+, NS6+, Opera 6+
      element = document.getEle mentById('mySpa n').style;
      } else if (document.layer s) {
      // NS4
      element = document.layers['mySpan'];
      } else if (document.all) {
      // IE < 5.5, Opera 5(?)
      element = document.all('m ySpan').style;
      }

      if (element) {
      element.visibil ity = 'visible';
      } else {
      alert("I hope you're reading this, because if you have
      JavaScript off, you will see nothing");
      }
      }

      --
      | Grant Wagner <gwagner@agrico reunited.com>

      * Client-side Javascript and Netscape 4 DOM Reference available at:
      *


      * Internet Explorer DOM Reference available at:
      *
      Gain technical skills through documentation and training, earn certifications and connect with the community


      * 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


      Comment

      Working...