Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: hiding frames

  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hiding frames

    Hi,

    I have a problem while hiding frames. first iam splitting the page into two frames. on load of the page i want to hide the second frame. and clicking on the button of the first frame i want to show the second frame. i am able to hide the frame on load only. but the area intended for the second frame is still showing . i want to cover the area intended for the second frame by the first frame if the second frame is hidden . Here is the code that i used for hiding the second frame on load of the page.


    <frameset rows="50%,*" frameborder="No" border="0" framespacing="0" rows="*" noresize>

    <frame name="3top" scrolling="yes" src="<%=msrc%>" noresize>

    <frame name="3main" scrolling="yes" src="<%=dsrc%>" style="display:'none';" noresize>

    </frameset>


    phani
    phani

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    <html>
    <frameset id="myFrameSet" rows="100%,*" frameborder="No" border="1" framespacing="0" noresize>
    <frame name="3top" scrolling="yes" src="<%=msrc%>" noresize>
    <frame name="3main" scrolling="yes" src="<%=dsrc%>" noresize>
    </frameset>
    </html>

    then in the first frame where the Show/Hide Frame button is:
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function showHideFrame(objBtn){
      var rowValue;
      if (objBtn.value=="Hide Frame"){
        objBtn.value="Show Frame";
        rowValue='100%,*';
      }
      else {
        objBtn.value="Hide Frame";
        rowValue='50%,*';
      }
      top.document.getElementById('myFrameSet').setAttribute('rows',rowValue);
    }
    </script>
    </head>
    <body>
    <form>
    <input type="button" value="Show Frame" onclick="showHideFrame(this)">
    </form>
    </html>
    setting the rows attribute to "100%,*" will hide the bottom frame and setting back to "50%,*" will show it.
    Last edited by glenngv; 10-11-2003 at 11:04 AM.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank u that was what i intended
    phani


  •  

    Posting Permissions

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