/    Sign up×
Community /Pin to ProfileBookmark

Opening each popup in a new window

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”>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@jzwpDec 26.2005 — <!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>

?
×

Success!

Help @jonasweb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...