Solved

script to hide scrollbar, menubar, no resize on current window

Posted on 2003-11-07
4
5,898 Views
Last Modified: 2011-10-03
i need a script hiding scrollbars and disallowing resize
menubar optional(have to deside later)
automatic (without link)
ideally working for ie and netscape mac supported

its late and i give up after having found hundreds of nearly right scripts (the pop up ones)
have no idea about javasript so cant translate these to what i want

help is much appriceated
0
Comment
Question by:martinkonrad
  • 2
4 Comments
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9705791
This is easy for popups coold you clarify what you mean by 'automatic (without link)'.
 For the users window opening your link you should not be fooling around with their browser window and this site (in my opinion) should not be giving advice on how to do it.
0
 

Author Comment

by:martinkonrad
ID: 9706800
i want to hide the scroll bars and the rest on opening of my website as i do not want the design to be distracted by it. scrollbars and menubar reduce effectife screen size and would hide part of design.
0
 
LVL 2

Accepted Solution

by:
Mikehd earned 125 total points
ID: 9718074
You'd have to open a new browser window to do that. you could use this:

window.open ("http://my_url", "title", 'WIDTH=800 HEIGHT=600,left='+(screen.width/2 - 800/2)+',top='+(screen.height/2 - 600/2)+',scrollbars=0');

This will create a new window 800x600, centered and without scrollbars.

Of course the centering works only for IE, for netscape(mozilla) you need to use "screenY" and "screenX" instead of left and top.

M=
0
 
LVL 2

Expert Comment

by:Mikehd
ID: 9722297
THanks for the points! I would of added the netscape check, but I didn't know this was the way you wanted to go.

I usually write this in a function that checks for the browser like so:

function openWindow (my_url, title){
      if (navigator.appName.toLowerCase() == "navigator"){
            window.open (my_url, title, 'WIDTH=800,HEIGHT=600,screenY='+(screen.width/2 - 800/2)+',screenX='+(screen.height/2 - 600/2)+',scrollbars=0');
      } else {
            window.open (my_url, title, 'WIDTH=800,HEIGHT=600,left='+(screen.width/2 - 800/2)+',top='+(screen.height/2 -600/2)+',scrollbars=0');
      }
}

then call it like so:

openWindow("http://myURl","myTitle");

This way you can reuse the code.

M=
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question