[thelist] opening sized window from jump menu
Rudy_Limeback at maritimelife.ca
Rudy_Limeback at maritimelife.ca
Mon Aug 21 12:52:41 CDT 2000
> I have a jump menu from which I'd like each menu item
> to open a new window that I can size. I have figured
> out the javascript to open a new window but have tried
> every way I can think of to size it to no effect.
> Do any of you know how to do this?
hi suellen
here's what i've used in the past to dynamically set window sizes --
<script type="text/javascript" language="JavaScript">
<!--
function pop(url,w,h) { width=w+20; height=h+20;
options = "width=" + width + ",height=" + height
+
"toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1"
var newWin = window.open(url, "pop", options) }
// -->
</script>
i call it with an href like this --
<a href="javascript://"
onClick="pop('foo.html',240,320)">foo</a>
but you can easily write this as an onChange for your jump menu SELECT
notice i add 20 pixels to the dimensions, this isn't really necessary,. i
just like to be safe in case i'm passing in a picture as the url, that way
i think i cover enough space for the default margins which i think are 10
in most cases
you could also parameterize the chrome, but those values are the ones i
always use on popups
i guess i could also shorten
"toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1"
to just
"resizable"
but since i always cut & paste from the last time i wrote code, i just
leave them in there in case i ever want to change the options
(which reminds me, i'm afraid i'm gonna have to look up screenx the next
time i need it again... )
rudy limeback
r937.com
evolt.org
More information about the thelist
mailing list