/    Sign up×
Community /Pin to ProfileBookmark

Popup multiple windows

Hi !

I’m a complete beginner in JS,
On my website I use a script that allows visitors to cick on thumbnails pics to see the actual photos in a popup window.
here’s an example:
[URL=http://effisk.chez.tiscali.fr/newcal_en.html]http://effisk.chez.tiscali.fr/newcal_en.html[/URL]
Now, my problem is that when you click on a thumbnail when a popup is up, the new photo will replace the previous in the popup, when I actually want to have a new window to popup (to be able to compare the two photos for instance).
I’m sure there’s a simple solution to that problem, but I just can’t find out what the solution is.

can anyone enlighten me here?

Cheers.

Effisk

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 15.2003 — [i]Originally posted by effisk [/i]

[B]Hi !



I'm sure there's a simple

Cheers.



Effisk [/B]
[/QUOTE]


As a matter of fact there is...

window.open() takes 3 paramters,first is the url of the page you want to open.

second is the name of this windiw.keep this second parameter unique and all windows will openin separate windows..

Here is rather simple example.

http://www.webapplikations.com/pages/html_js/window/OpenMultipleWindows.html
Copy linkTweet thisAlerts:
@effiskauthorAug 15.2003 — thx 4 your reply!

I'll check your link!

Effisk
Copy linkTweet thisAlerts:
@effiskauthorAug 15.2003 — I'm lost in your script, it's way too complicated for me! :eek:

What should I add to my script, and where?

cheers

effisk
Copy linkTweet thisAlerts:
@effiskauthorAug 15.2003 — here's my script in the header:

<!-- Begin

function PopupImage(img) {

titre="New Caledonia Photos"; w=open("",'image','width=40,height=40,toolbar=no,scrollbars=no,resizable=no,left=70,top=40');

w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");

w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+29); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");

w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");

w.document.write("");

w.document.write("</BODY></HTML>");

w.document.close();

}

// End -->


and the script for the links:

<A HREF="javascript?opupImage('photoX.gif')"><img src="thumbnailX.gif">

You can notice that the title is defined in the header, so the title is the same for all the popups. I'm not sure how to change this...

hope this helps.

cheers.

Effisk
Copy linkTweet thisAlerts:
@Khalid_AliAug 15.2003 — Take a look at this line in your code

w=open("" ,[b]'image'[/b],'width=40,height=40,toolbar=no,scrollbars

=no,resizable=no,left=70,top=40');

notice the value in [b]bold[/b]

make sure that is unique for all windows that you might open.Rest of the code you have should wor as is
Copy linkTweet thisAlerts:
@effiskauthorAug 15.2003 — I must be thick I didn't get what you said. ?

So, in a desperate move and in last resort,

I plainly removed [B]image[/B] from the script,

just in case, you never know, and wonder...

IT WORKED !!! I can have several popups !!!!! ? ?

YES YES !

I want to thank my parents, santa claus and Jennifer Lopez for their support, Khalid for his patience,

special thanks 2 me crew, the whole block especially the girl next door, regards to her boyfriend,

I LOVE MY PLANET.

cheers.

effisk.
×

Success!

Help @effisk 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...