PDA

View Full Version : Pop-up Window Resize - Please Help!


webrock
09-21-2003, 07:42 PM
Hi,

Can someone please let me know where I would insert the code for sizing these pop-up windows to a specific height & width??? Here's what I've got so far.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">

var putItThere = null;
var chasm = screen.availWidth;
var mount = screen.availHeight;
var wd = chasm*.9; // percentage of screen width occupied by pop-up
var ht = mount*.8; // percentage of screen height occupied by pop-up

function deadCenter(url)
{
putItThere = window. open(url,'putItThere','width='+wd+',height='+ht+',
left='+((chasm-wd-10)*.5)+',top='+((mount-ht-5)*.5)+',scrollbars,status,titlebar');
if (putItThere & !putItThere.closed)
putItThere.focus();
}

</script>
</head>
<body>
<form name="f1">
<select name="s1">
<option value="" selected="selected">- Choose Your Girl -</option>
<option value="jcorday.htm">Corday</option>
<option value="cindy.html">Cindy Alexander</option>
</select>
<input type="button" name="mybutton" value="Go"
onclick="v=s1.options[s1.selectedIndex].value;if(v)return deadCenter(v)">
</form>
</body>
</html>

Thanks so much!

sciguyryan
09-21-2003, 09:45 PM
<script type="text/javascript">
function openwin(url, width, height) {

var name = "popup"; // popup name
var width = width; // popup width
var height = height; // popup height
var left = (screen.width - width) / 2 ;
var top = (screen.height - height) / 2;
var windowproperties = "width="+ width +",height="+ height +",left="+ left +",top="+ top +",scrollbars=1";
window.open(url, name, windowproperties);

}
</script>

heres a script but, you will have to alter it...

sciguyryan
09-21-2003, 09:52 PM
or, you could use the opening likk to do it like so:

<a href="http://www.webdevfaqs.com" onclick="window.open(this.href,'child','width=600,height=400,scrollbars=1'); return false;">Open popup</a>

webrock
09-21-2003, 11:00 PM
would this be inserted within the code I posted?

sciguyryan
09-22-2003, 01:41 PM
when oyu open the window well, this is the a href version of that, you can use any opening event to do so....