Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-11-07
4
Medium Priority
?
5,915 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 375 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

885 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