View Full Version : Auto-sizing pop-up window?
digitalpoint
Mar 5th 2004, 12:32 pm
I'm sure there must be a way to do it, but I have no clue... Let's say I pop open a window with Javascript, and it displays a table of info that can vary in size both vertically and horizontally.
Is there a way with Javascript (or anything else) that could auto-size the widow to fit the table?
- Shawn
Mr T
Mar 7th 2004, 3:05 am
Are you able to work out the size of the table? If so, you could just set the window to be big enough.
This (http://www.w3schools.com/js/tryit.asp?filename=tryjs_openallwindow) sort of technique.
digitalpoint
Mar 7th 2004, 12:43 pm
No, the table is variable (not being able to know the size)...
- Shawn
Foxy
Mar 9th 2004, 12:12 am
Wouldn't you have to dynamically create the data and then take that info which would need to have a size reference library to give you the dimensions that you could then dynamically place in the code for the window size and then call the window?
digitalpoint
Mar 9th 2004, 7:38 am
Doing it that way isn't an option... It needs to be sized after the fact (after the window pops). To give an idea of what it's for, it's within the keyword tracker. When you have the option to show surrounding URLs and a manual query opens the pop-up window showing the various URLs.
Not mission critical, but it would be nice I think...
- Shawn
Foxy
Mar 9th 2004, 10:57 am
MMmmmm
I've had to many sherbets at lunch!
I'll think on this one :cool:
TampaDave
Mar 30th 2004, 8:46 am
This script will resize a window on load, but you'll have to tinker to figure out variable reszing based on content.
My suggestion would be to go with a fixed window size and then make yout table variable to fill it.
BTW, one advantage of this is you can open the page witha regualr link, so it won;t get blocked by pop-up blockers.
<script language="JavaScript">
<!--
function opener() {
window.open('logger.asp','Login','toolbar=no,status=no,scrollbars=no,locatio
n=no,menubar=no,directories=no,width=500,height=300')}
-->
</script>
</head>
<body onLoad="opener()">
TampaDave
digitalpoint
Mar 30th 2004, 8:59 am
Yeah, that's what I'm doing now... sizing it statically with JavaScript. Would just be nice to be able to adjust it after the page loaded somehow.
- Shawn
phrozen_ra
Jan 18th 2005, 3:55 am
window.resizeTo(300, 200)
that will resize to width 300 and height 200... use it wise ;)
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.