Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Menu Bar on page load

Status
Not open for further replies.

IndyGill

Technical User
Joined
Jan 15, 2001
Messages
191
Location
GB
Hi,

I must first say that im am a novice when it comes to Javascript

I am trying to resize and hide the toolbar of a window as soon as it opens. However I cannot do the resize on the hyperlink that opens the page eg.

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
onClick="MM_openBrWindow('del.htm','','width=300,height=200')"


I need to do it on the page load after the user has clciked a hyperlink eg..

<a href:"newpage.aspx" target="_blank">open page</a>

So on my new page I use the following javascript top resize the window:

<!--
br=navigator.appName;
brversion=parseInt(navigator.appVersion);
{
window.resizeTo(420,600);
}
//-->

However I am unsure of the syntax of how I can hide the toolbars in this function

Any ideas

Thanks in advance
 
I think your best bet is to make the toolbar changes when you open the window.

so Open your window with the MM_openBrWindow function and send it toolbar=no in the features variable.

Here is a fairly complete list of features you can assign to an opening window.

window.open("mypage.htm", "example1", "width=420, height=600, location=yes, menubar=yes, status=yes, toolbar=no, scrollbars=yes, resizable=yes");

IE (as far as I know) will not allow you to remove the toolbar (or other chrome) from the existing page. In Netscape however you can do this:

window.open('','_top','menubar=0,location=0,toolbar=0, personalbar=0,status=1,scrollbars=1');

to make changes to the existing window. Not very useful seeing as it isn't cross browser but it's good to know.




Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
Thanks for that Tlhawkins

But I cant really use that method as it will refesh the page that has the hyperlinklink, I cant allow this to happen as I have a lot of state management happening on the page.

Is there no way I can get rid of the toolbars from within the page i am calling?
 

>> Why can't they all just get together and make one browser that does it all!

Then I'd be out of a job as a cross-browser expert ;o)

 
hehe... true.

and I would have to bill 1/2 as much when making web pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top