Click to See Complete Forum and Search --> : Opening each popup in a new window


jonasweb
12-26-2005, 01:52 PM
Hi, I hope someone can help -- I don't think this is too hard, but I don't know how to do it. My client needs for their visitors to be able to open more than one product detail popup window at a time, and right now this code just replaces the first open popup with each new one. Each subsequent popup must open in a separate window, leaving any other popups open.

Here's the code I'm using. Can somebody please help? Thank you!!

function openWindow(url, name) {
popupWin = window.open(url, name, 'width=580,height=500,left=10,top=10,scrollbars=yes')
}

and the links are:
<a href="index.php?id=$id" onClick="javascript:openWindow("index.php?id=$id');return false">

jzwp
12-26-2005, 05:09 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE> NewWindows </TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/CSS>

</STYLE>
<SCRIPT language=JavaScript>
var winName=0;
function oNewWin(url){
winName++;tx=winName*10;lx=winName*10;
window.open(""+url+"",""+winName+"","top="+tx+",left="+lx+",status=yes,Resizable=yes,width=580,height=500");
}
</SCRIPT>
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
</HEAD>
<BODY>
<a href="javascript:oNewWin('http://wherever')">link1</a><br>
<a href="javascript:oNewWin('http://wherever')">link2</a><br>
<a href="javascript:oNewWin('http://wherever')">link3</a><p>


</BODY></HTML>
:confused: