Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

757 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

23 Experts available now in Live!

Get 1:1 Help Now