Links open different size windows.

[Total: 0    Average: 0/5]

This example shows how to have one function open up windows with different sizes.

Body Code:

<script>
var myWin = null;

function popUp(url,x) {
var _w='400';
var _h='300';
if (x && x==1) { _w='500';_h='400'; }
if (x && x==2) { _w='500';_h='479'; }
var _parms = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width='+_w+',height='+_h;
myWin=window.open(url,"win1",_parms,true);
myWin.focus();
self.name = "mainWin";
}

</script>
<a href="javascript:popUp('http://www.js-examples.com')">pop normal</a><BR>
<a href="javascript:popUp('http://www.js-examples.com',1)">pop low</a><BR>
<a href="javascript:popUp('http://www.js-examples.com/forums/',2)">pop high</a><BR>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *