This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Front Page > June 2004 > Specify new window size





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Specify new window size
Pete

2004-06-29, 7:14 am

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



MD Websunlimited

2004-06-29, 12:14 pm

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/...w_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/...ew/codeview.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible


"Pete" <pete@SPAMOFFpw9.co.uk> wrote in message news:Z6aEc.348$r74.98@fe1.news.blueyonder.co.uk...
> 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
>
>
>



Stefan B Rusynko

2004-06-29, 12:14 pm

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+""); };

--

_____________________________________________
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
_____________________________________________


"MD Websunlimited" <none@none.com> wrote in message news:e1enf%23cXEHA.1656@TK2MSFTNGP09.phx.gbl...
| 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/...w_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/...ew/codeview.htm
| FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
|
|
| "Pete" <pete@SPAMOFFpw9.co.uk> wrote in message news:Z6aEc.348$r74.98@fe1.news.blueyonder.co.uk...
| > 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
| >
| >
| >
|
|


Pete

2004-06-29, 7:15 pm

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" <sbr_enjoy@hotmail.com> wrote in message
news:eRQVfIdXEHA.1152@TK2MSFTNGP09.phx.gbl...
> 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
> _____________________________________________
>
>
> "MD Websunlimited" <none@none.com> wrote in message

news:e1enf%23cXEHA.1656@TK2MSFTNGP09.phx.gbl...
> | 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/...w_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/...ew/codeview.htm
> | FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
> |
> |
> | "Pete" <pete@SPAMOFFpw9.co.uk> wrote in message

news:Z6aEc.348$r74.98@fe1.news.blueyonder.co.uk...
> | > 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
> | >
> | >
> | >
> |
> |
>
>




Stefan B Rusynko

2004-06-29, 7:15 pm

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

--

_____________________________________________
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
_____________________________________________


"Pete" <pete@SPAMOFFpw9.co.uk> wrote in message news:i3hEc.337$vC4.336@fe1.news.blueyonder.co.uk...
| 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" <sbr_enjoy@hotmail.com> wrote in message
| news:eRQVfIdXEHA.1152@TK2MSFTNGP09.phx.gbl...
| > 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
| > _____________________________________________
| >
| >
| > "MD Websunlimited" <none@none.com> wrote in message
| news:e1enf%23cXEHA.1656@TK2MSFTNGP09.phx.gbl...
| > | 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/...w_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/...ew/codeview.htm
| > | FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
| > |
| > |
| > | "Pete" <pete@SPAMOFFpw9.co.uk> wrote in message
| news:Z6aEc.348$r74.98@fe1.news.blueyonder.co.uk...
| > | > 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
| > | >
| > | >
| > | >
| > |
| > |
| >
| >
|
|
|


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews