Solved

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

Posted on 2003-11-07
4
5,896 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now