470,594 Members | 1,162 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Resizable pop up windows in IE

Morning All,

I have a web application where we pop up a little calendar control in a
new window to allow users to choose dates. For cross-browser purposes,
this is done via window.open (with some code to make it behave like a
modal dialog) and I set the width and height of the window such that
the controls fit nicely and it all looks good.

I have some users who are unable to see the OK and Cancel buttons at
the bottom of the window due to some display settings on their
machines. OK, I though, I'll just make the window resizable and they
can then take control. How naive of me! Why on earth does IE decide
that the minute I put 'resizable=yes' into my attributes for the new
window that it should ignore the size?

I know I can do window.resizeTo in the onload of the calendar window,
but I'm not keen on the resizing of the window.

I don't suppose anyone knows of a way to have IE open a resizable
window of a given size without the resizeTo?

Thanks,
Al.

Oct 20 '06 #1
3 2075
ASM
Al Henderson a écrit :
>
I don't suppose anyone knows of a way to have IE open a resizable
window of a given size without the resizeTo?
var truc = false;

function pop(page) {
if(!truc || truc.closed)
truc = window.open('','','width=250,height=125,resizable= 1');
truc.location = page;
truc.focus();
}
Variations :

var w = 225;
var h = 131;
attributes = 'width='+w+',height='+h;
attrResiz = attributes+',resizable=1';
attrScroll = attributes+',scrollbars=1';
attrScrollResiz = attrResiz+',scrollbars=1';

truc = window.open('','',attrResiz);
Possible attributes to mix :

top=125 (margin hight in pixels)
left=... (margin left)
width= (width in px)
height=
scrollbars=0/1 (0 or 1 = no or yes)
menu=0/1
menubar=0/1 (on Mac menu can't be disabled)
satus=0/1 (FF always displays status bar)
location=0/1
toolbar=0/1
history=0/1 (IE only)
resizable=0/1 (if 0 in FireFox the resizeTo is disabled)

if no attribute : normal window
if some attributes, those ignored would be to 'no'

--
ASM
Oct 20 '06 #2
Al Henderson wrote:
Morning All,

I have a web application where we pop up a little calendar control in a
new window to allow users to choose dates. For cross-browser purposes,
this is done via window.open (with some code to make it behave like a
modal dialog) and I set the width and height of the window such that
the controls fit nicely and it all looks good.

I have some users who are unable to see the OK and Cancel buttons at
the bottom of the window due to some display settings on their
machines. OK, I though, I'll just make the window resizable and they
can then take control. How naive of me! Why on earth does IE decide
that the minute I put 'resizable=yes' into my attributes for the new
window that it should ignore the size?

I know I can do window.resizeTo in the onload of the calendar window,
but I'm not keen on the resizing of the window.

I don't suppose anyone knows of a way to have IE open a resizable
window of a given size without the resizeTo?
YUK! Don't use new windows - you'll run into these browser compatibility issues! Use a proper Calendar widget: http://developer.yahoo.com/yui/examp...dar/index.html

If you need to pop up windows with extra info in, us a Dialog: http://developer.yahoo.com/yui/examp...ner/index.html

Basically, use the YAHOO UI!

Nige
Oct 21 '06 #3
This doesn't work (and is pretty close to the code I had already!). If
I have:

var newWindow = false;

function NewWindow()
{
if(!newWindow || newWindow.closed)
{
newWindow = window.open("", "", "width=250,height=125,resizable=1");
newWindow.location = "http://..../test.html";
newWindow.focus();
}
}

and I call NewWindow from a button onclick, then I get a new browser
window the same size as my parent - it ignores the size specifications.
Am I missing something?

Thanks,
Al.

ASM wrote:
Al Henderson a écrit :

I don't suppose anyone knows of a way to have IE open a resizable
window of a given size without the resizeTo?

var truc = false;

function pop(page) {
if(!truc || truc.closed)
truc = window.open('','','width=250,height=125,resizable= 1');
truc.location = page;
truc.focus();
}
Variations :

var w = 225;
var h = 131;
attributes = 'width='+w+',height='+h;
attrResiz = attributes+',resizable=1';
attrScroll = attributes+',scrollbars=1';
attrScrollResiz = attrResiz+',scrollbars=1';

truc = window.open('','',attrResiz);
Possible attributes to mix :

top=125 (margin hight in pixels)
left=... (margin left)
width= (width in px)
height=
scrollbars=0/1 (0 or 1 = no or yes)
menu=0/1
menubar=0/1 (on Mac menu can't be disabled)
satus=0/1 (FF always displays status bar)
location=0/1
toolbar=0/1
history=0/1 (IE only)
resizable=0/1 (if 0 in FireFox the resizeTo is disabled)

if no attribute : normal window
if some attributes, those ignored would be to 'no'

--
ASM
Oct 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by VR | last post: by
1 post views Thread by Catherine Jo Morgan | last post: by
4 posts views Thread by sam.s.kong | last post: by
3 posts views Thread by Anupama | last post: by
11 posts views Thread by Aaron Gray | last post: by
3 posts views Thread by guarumal | last post: by
3 posts views Thread by Thierry Loiseau | last post: by
2 posts views Thread by Rastko Soskic | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.