How do I hide a layer with the onLoad event handler?

Discussion in 'Javascript' started by lee@dnuk.com, Dec 7, 2006.

  1. Guest

    Hello

    I need to hide a layer after a set time when the page loads.

    Let's say a 1000ms (a second).

    Now this works as you'd expect:

    <body onLoad="PopUp.style.visibility='hidden';">

    Which closes the layer so quick the user cannot see it.
    I need it to close after 1 second. I'd thought this would work, but it
    does not:

    <onLoad="setTimeout('PopUp.style.visibility='hidden';', 1000);">


    Does anyone know how to hide the layer after a set time?

    Thanks
     
    , Dec 7, 2006
    #1
    1. Advertising

  2. pcx99 Guest

    wrote:
    > <onLoad="setTimeout('PopUp.style.visibility='hidden';', 1000);">


    <onLoad="setTimeout('PopUp.style.visibility=\'hidden\';', 1000);">

    Quotes within quotes within quotes need to be escaped \'


    ---------------------------------------------------------------------------
    http://www.hunlock.com
    $FA
     
    pcx99, Dec 7, 2006
    #2
    1. Advertising

  3. naixn Guest

    pcx99 wrote :
    > wrote:
    >> <onLoad="setTimeout('PopUp.style.visibility='hidden';', 1000);">

    >
    > <onLoad="setTimeout('PopUp.style.visibility=\'hidden\';', 1000);">
    >
    > Quotes within quotes within quotes need to be escaped \'
    >
    >
    > ---------------------------------------------------------------------------
    > http://www.hunlock.com
    > $FA


    Just in case :
    <onLoad="setTimeout('PopUp.style.display: \'none\';', 1000);">

    --
    Naixn
    http://fma-fr.net
     
    naixn, Dec 7, 2006
    #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. =?Utf-8?B?YzY3NjIyOA==?=

    do it in database layer or application layer

    =?Utf-8?B?YzY3NjIyOA==?=, Jan 26, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    436
    Karl Seguin [MVP]
    Jan 27, 2006
  2. Noozer
    Replies:
    1
    Views:
    5,498
    Roy Schestowitz
    Mar 22, 2006
  3. Dhananjay
    Replies:
    1
    Views:
    1,130
    sloan
    Dec 18, 2006
  4. Replies:
    1
    Views:
    716
    Damien
    Feb 22, 2007
  5. Replies:
    5
    Views:
    267
    Thomas 'PointedEars' Lahn
    May 15, 2005
Loading...

Share This Page