Forum Moderators: open

Message Too Old, No Replies

How to turn off menu bar in new window

         

Lorel

7:48 pm on Aug 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I use code that allows one to click on a link and a new window opens up according to the size I specify. I want to turn off the menu bar (name of the browser appears here). I don't write JS so if someone can tell me what to change in the code below it would be appreciated:

<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random() *(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random() *((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100; TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") ¦¦ pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+', left='+LeftPosition+',scrollbars='+scroll+',location=no, directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->
</script>

Here is the relevant HTML:

<a href="des/analysis.html" onclick="NewWindow(this.href,'des','450','150','no','center');return false" onfocus="this.blur()">Analysis</a>

[edited by: jatar_k at 9:08 pm (utc) on Aug. 3, 2005]
[edit reason] fixed sidescroll and removed url [/edit]

RonPK

8:28 am on Aug 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code already says 'menubar=no', so there shouldnt be a menu bar. I'm a bit confused when you say "menu bar (name of the browser appears here)", because that bar (the blue one at the top) is usually referred to as title bar. You can't hide that one with javascript.

Lorel

2:40 pm on Aug 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ok, thanks Ron,

I didn't get an answer so went looking for a Javascript tutorial and found one so I know how to edit it now.