...

View Full Version : Window PopUPs



tadaw79
10-21-2003, 07:14 AM
I have a script that allows me to set the size of each popup windows independently, how can i modify this script so that i can set the position of the window also ? I have pasted the script below:

<script type="text/javascript">
function openWindow(url,h,w){
window.open(url,"","height="+h+",width="+w+",scrollbars,status");
}
</script>



This is in the body

<a href="http://" onclick="openWindow('products.html','400','300');return false">Open window</a>

fredmv
10-21-2003, 07:40 AM
Try this:
function openWindow( url, h, w, x, y )
{
w = window.open(url, "", "height="+h+", width="+w+",scrollbars,status");
w.moveTo( x, y );
}


Then call it like this:
<a href="#" onclick="openWindow('products.html', '400', '300', '0', '0');">Open window</a>Good luck.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum