Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery 2 23
how can i get the string decoded ? 2 28
jQuery on Submit 4 44
javascript - insert into js doc help 2 25
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

830 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