Resizable pop up windows in IE

A

Al Henderson

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.
 
A

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'
 
T

TheBagbournes

Al said:
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/examples/calendar/index.html

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

Basically, use the YAHOO UI!

Nige
 
A

Al Henderson

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top