Results 1 to 2 of 2

Thread: Hiding frames

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    266
    Hi all,
    I have got two frames on an HTML page. The first frame has a form with a button. When I click on the button I want to make the second form invisible. How do I do that in VBScript or JavaScript.
    Thanks in advance.

  2. #2
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    Try this:

    ************************************************************
    <html>
    <head>
    <title>Hiding my Div</title>
    <script language = "javascript">
    function Hide()
    {
    MyDiv.style.visibility = 'hidden';
    }
    </script>
    </head>
    <body>
    <br><br><br>
    <DIV ALIGN = "CENTER" ID = "MyDiv">
    This is my div
    </DIV>
    <br>
    <br>
    <input type="button" value = "Hide Div" ONCLICK="Hide()">
    </body>
    </html>
    ************************************************************

    I believe to access this cross-frame just prefix the MyDiv in the function with the name of your frame. Make sure that you wrap the form in a DIV tag and give the DIV tag an ID to refer to it in the javascript function.

    Copy and paste the above HTML into notepad and save it as MyDiv.html to see it work. By clicking on the button the text in the Div tag disappears.


    Psyrus


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width