View Full Version : Resizing a pop-up window based on document size.
Lee Brenner
09-09-2002, 08:54 PM
I have an application in which a user can open a pop-up window that has 2 select boxes. Those select boxes are populated from a database query so their widths can vary depending on what data is going into them. I would like to be able to resize the pop-up window dynamically so that it shows the entire contents of its document (smaller when the select boxes are smaller, wider when the select boxes are wider).
Does anyone have any suggestions as to how I might get the current size of the document?
beetle
09-09-2002, 08:59 PM
if (window.innerWidth < document.width) window.resizeTo(document.width, intHeight);
Where intHeight is an integer containing the static height of the popup.
Lee Brenner
09-09-2002, 09:24 PM
window.innerWidth and document.width are both undefined...I'm using IE.
Thanks for the help though! It got me thinking and I'm getting the width of the 2 select boxes via .scrollWidth.
beetle
09-11-2002, 01:35 PM
I think I looked up both of those properties at Mozilla's site (read: Gecko)
Go here for the IE reference
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtmlrefs.asp
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.