View Full Version : popup question with a twist
srowley
03-08-2005, 01:54 PM
I am in need of code that will resize a browser window, control the position and control the visibility of scrollbars, menus and toolbars on a web page. The link for this page will be contained in an e-mail so I need all of the code be contained in the target page not like the typical popup scripts that I have seen.
If there is anyone who could help I would greatly appreciate it.
You can add several parameters for the new window.
This will allow you to control the size as well as which parts of the browser should be available in the window.
option explanation
toolbar = yes | no add/remove browsers toolbar
location = yes | no add/remove browsers location field
directories = yes | no add/remove browsers directories field
status = yes | no add/remove browsers status field
menubar = yes | no add/remove browsers menubar
scrollbars = yes | no add/remove browsers scrollbars
resizeable = yes | no allow new window to be resizable
width = value window width in pixels
height = value window height in pixels
An example showing the way to define which parts of the browser should be visible is shown below:
PageURL="http://www.mydomain.com/myfile.html";
WindowName="MyPopUpWindow";
settings=
"toolbar=yes,location=yes,directories=yes,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width=600,height=300";
MyNewWindow=
window.open(PageURL,WindowName,settings);
Note:
There are no spaces between the settings.
If you add spaces here, the window will not open correctly in Netscape browser
Hope this helps.. this is found at http://www.echoecho.com/jswindows02.htm
Blessings, David
Elriowiel
03-09-2005, 02:53 AM
I don't know what you mean when you say controlling the visibility of scrollbars... aside from what David said, the following code resizes a browser window...
just insert it somewhere in your page.
<script>
window.resizeTo('300','300');
</script>
enjoy!
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.