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 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Overriding frameset

    I have a menubar across the top of a page in a separate frame. Content loads into main frame below it. I'm adding an onClick menu option that I'd like to open in the same, full window, without the menubar frame on top. Any way to do this?

    Thx.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Try this:-

    Code:
    <body onload = "fullscreen()">
    
    <script type = "text/javascript">
    function fullscreen() {
    Width=screen.availWidth;
    Height=screen.availHeight;
    window.open('myPage.html', '', 
    'toolbar=no,location=no,directories=no,status=no,menubar=no,'+
    'scrollbars=1,resizable=no,copyhistory=1,width='+Width+','+
    'height='+Height+',top=0,left=0','replace');
    } 
    </script>
    We went to university together, but not at the same time. - Keith Vaz MP

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Won't have time to try til tonight, but just eyeballing it quickly, looks like it opens a new window, which is not what I want to do. I'd like the link from the menu bar to open the new page in the same window, without the frameset.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    The second parameter of window.open() is a string representing the name of the target window. Set it to: "_self".

  • #5
    New Coder
    Join Date
    Jun 2010
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    That's the problem. If I point it to _self, it opens the new page in the top menu frame (30px height). I can load the new page into either of the two frames, but can't open it into the same window without frames. That's what I'm trying to do, eliminate the frameset when the new page loads.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,553
    Thanks
    78
    Thanked 4,382 Times in 4,347 Posts
    Set it to _top.

    Indeed _self does mean that same thing that self. means in JS coding.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    Krashsite (11-11-2010)

  • #7
    New Coder
    Join Date
    Jun 2010
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well bugger me with a fishfork.

    It works. I had tried targeting _top, but with different syntax (target="_top", if iirc), and it didn't work, but I'm using...

    Code:
    <input type="button" style="width:60px; margin-top:5px; font-size:8pt; color:#99ff00; background:#282874" value="Forum" onClick="window.open('/smfannex/','_top');">
    ...and it does exactly what I wanted.

    Thanks, OP!

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Alternative solution:
    Code:
    onclick="top.location.href='/smfannex/';"


  •  

    Posting Permissions

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