Specify new window size

P

Pete

Is there an easy way to specify what size a new window will be when opened.
Ideally, it would be best to be able to open the window where the size would
be relative to a users screen resolution/size.
I use Spawn from Jimco AddIns which allows this for images but not for other
web pages.
Any ideas?
Thanks.

Pete
 
M

MD Websunlimited

Hi Pete,

I don't know of any popup window code that opens in a size relative to the users screen resolution but it is possible to do.

You may wish to take a look at J-Bots Pop-up windows / Window Close components.
http://www.websunlimited.com/order/Product/General/popup_window_component.htm

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Need to manage your code snippets in FP? Take a look at CodeView!
http://www.websunlimited.com/order/Product/CodeView/codeview.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
 
S

Stefan B Rusynko

This script comes close for most browsers
Invoked by passing Variables: content,title,setW,setH
(setW & setH are optional to change the default popup size from var wide= 600, high= 400)

onclick="showPopUp('path/page.htm','Window Title Text');return false;"

// POPUP WINDOWS
function showPopUp(content,title,setW,setH) {
if (setW > 0 && setH > 0) { var wide= setW, high= setH; } else { var wide= 600, high= 400; };
var x = 0, y = 0;
var agt=navigator.userAgent.toLowerCase();
var is_aol = (agt.indexOf("aol") != -1); browsername=navigator.appName;
if (browsername.indexOf("Microsoft")!=-1) {
var xMax = document.body.clientWidth, yMax = document.body.clientHeight;
var x = window.screenTop, y = window.screenLeft;
} else if (browsername.indexOf("Netscape")!=-1) {
var xMax = window.innerWidth, yMax = window.innerHeight;
var x = window.screenX, y = window.screenY + 20;
} else { var xMax = wide, yMax = high; var x = 0, y = 0;} ;
var xOffset = x + (xMax - wide)/2, yOffset = y + (yMax - high)/2;
if (is_aol) {var xOffset = 0, yOffset = 0 };
window.open(content,null,"scrollbars=1,resizable=1,width="+wide+",height="+high+",screenX="+xOffset+",screenY="+yOffset+",left="+xOf
fset+",top="+yOffset+""); };

--




| Hi Pete,
|
| I don't know of any popup window code that opens in a size relative to the users screen resolution but it is possible to do.
|
| You may wish to take a look at J-Bots Pop-up windows / Window Close components.
| http://www.websunlimited.com/order/Product/General/popup_window_component.htm
|
| --
| Mike -- FrontPage MVP '97-'02
| http://www.websunlimited.com
| Need to manage your code snippets in FP? Take a look at CodeView!
| http://www.websunlimited.com/order/Product/CodeView/codeview.htm
| FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
|
|
| > Is there an easy way to specify what size a new window will be when opened.
| > Ideally, it would be best to be able to open the window where the size would
| > be relative to a users screen resolution/size.
| > I use Spawn from Jimco AddIns which allows this for images but not for other
| > web pages.
| > Any ideas?
| > Thanks.
| >
| > Pete
| >
| >
| >
|
|
 
P

Pete

Thanks for that, I'll give that a go later.
Will this mean that new windows opened will be recognised as a popup which
could be blocked by a firewall?
--
Pete

Stefan B Rusynko said:
This script comes close for most browsers
Invoked by passing Variables: content,title,setW,setH
(setW & setH are optional to change the default popup size from var wide= 600, high= 400)

onclick="showPopUp('path/page.htm','Window Title Text');return false;"

// POPUP WINDOWS
function showPopUp(content,title,setW,setH) {
if (setW > 0 && setH > 0) { var wide= setW, high= setH; } else { var wide= 600, high= 400; };
var x = 0, y = 0;
var agt=navigator.userAgent.toLowerCase();
var is_aol = (agt.indexOf("aol") != -1); browsername=navigator.appName;
if (browsername.indexOf("Microsoft")!=-1) {
var xMax = document.body.clientWidth, yMax = document.body.clientHeight;
var x = window.screenTop, y = window.screenLeft;
} else if (browsername.indexOf("Netscape")!=-1) {
var xMax = window.innerWidth, yMax = window.innerHeight;
var x = window.screenX, y = window.screenY + 20;
} else { var xMax = wide, yMax = high; var x = 0, y = 0;} ;
var xOffset = x + (xMax - wide)/2, yOffset = y + (yMax - high)/2;
if (is_aol) {var xOffset = 0, yOffset = 0 };
window.open(content,null,"scrollbars=1,resizable=1,width="+wide+",height="+h
igh+",screenX="+xOffset+",screenY="+yOffset+",left="+xOf
fset+",top="+yOffset+""); };

--




| Hi Pete,
|
| I don't know of any popup window code that opens in a size relative to
the users screen resolution but it is possible to do.
 
S

Stefan B Rusynko

No on the popup - if the user clicks on a link to open it

--




| Thanks for that, I'll give that a go later.
| Will this mean that new windows opened will be recognised as a popup which
| could be blocked by a firewall?
| --
| Pete
|
| | > This script comes close for most browsers
| > Invoked by passing Variables: content,title,setW,setH
| > (setW & setH are optional to change the default popup size from var wide=
| 600, high= 400)
| >
| > onclick="showPopUp('path/page.htm','Window Title Text');return false;"
| >
| > // POPUP WINDOWS
| > function showPopUp(content,title,setW,setH) {
| > if (setW > 0 && setH > 0) { var wide= setW, high= setH; } else { var wide=
| 600, high= 400; };
| > var x = 0, y = 0;
| > var agt=navigator.userAgent.toLowerCase();
| > var is_aol = (agt.indexOf("aol") != -1); browsername=navigator.appName;
| > if (browsername.indexOf("Microsoft")!=-1) {
| > var xMax = document.body.clientWidth, yMax = document.body.clientHeight;
| > var x = window.screenTop, y = window.screenLeft;
| > } else if (browsername.indexOf("Netscape")!=-1) {
| > var xMax = window.innerWidth, yMax = window.innerHeight;
| > var x = window.screenX, y = window.screenY + 20;
| > } else { var xMax = wide, yMax = high; var x = 0, y = 0;} ;
| > var xOffset = x + (xMax - wide)/2, yOffset = y + (yMax - high)/2;
| > if (is_aol) {var xOffset = 0, yOffset = 0 };
| >
| window.open(content,null,"scrollbars=1,resizable=1,width="+wide+",height="+h
| igh+",screenX="+xOffset+",screenY="+yOffset+",left="+xOf
| > fset+",top="+yOffset+""); };
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| | > | Hi Pete,
| > |
| > | I don't know of any popup window code that opens in a size relative to
| the users screen resolution but it is possible to do.
| > |
| > | You may wish to take a look at J-Bots Pop-up windows / Window Close
| components.
| > |
| http://www.websunlimited.com/order/Product/General/popup_window_component.htm
| > |
| > | --
| > | Mike -- FrontPage MVP '97-'02
| > | http://www.websunlimited.com
| > | Need to manage your code snippets in FP? Take a look at CodeView!
| > | http://www.websunlimited.com/order/Product/CodeView/codeview.htm
| > | FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
| > |
| > |
| | > | > Is there an easy way to specify what size a new window will be when
| opened.
| > | > Ideally, it would be best to be able to open the window where the size
| would
| > | > be relative to a users screen resolution/size.
| > | > I use Spawn from Jimco AddIns which allows this for images but not for
| other
| > | > web pages.
| > | > Any ideas?
| > | > Thanks.
| > | >
| > | > Pete
| > | >
| > | >
| > | >
| > |
| > |
| >
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top