PDA

View Full Version : Overriding frameset



Krashsite
Nov 10th, 2010, 04:31 AM
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.

Philip M
Nov 10th, 2010, 09:39 AM
Try this:-


<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

Krashsite
Nov 10th, 2010, 07:21 PM
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.

Philip M
Nov 10th, 2010, 08:22 PM
The second parameter of window.open() is a string representing the name of the target window. Set it to: "_self".

Krashsite
Nov 11th, 2010, 01:38 AM
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.

Old Pedant
Nov 11th, 2010, 02:16 AM
Set it to _top.

Indeed _self does mean that same thing that self. means in JS coding.

Krashsite
Nov 11th, 2010, 04:00 AM
Well bugger me with a fishfork. http://www.thekrashsite.com/annex/forum/eek.gif

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



<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! http://www.thekrashsite.com/annex/forum/thu.gif

glenngv
Nov 11th, 2010, 10:21 AM
Alternative solution:

onclick="top.location.href='/smfannex/';"