Click to See Complete Forum and Search --> : Popup multiple windows
effisk
08-15-2003, 08:33 AM
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:
http://effisk.chez.tiscali.fr/newcal_en.html
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
Khalid Ali
08-15-2003, 08:46 AM
Originally posted by effisk
Hi !
I'm sure there's a simple
Cheers.
Effisk
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
effisk
08-15-2003, 08:53 AM
thx 4 your reply!
I'll check your link!
Effisk
effisk
08-15-2003, 08:55 AM
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
effisk
08-15-2003, 09:04 AM
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:PopupImage('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
Khalid Ali
08-15-2003, 09:53 AM
Take a look at this line in your code
w=open("" ,'image','width=40,height=40,toolbar=no,scrollbars
=no,resizable=no,left=70,top=40');
notice the value in bold
make sure that is unique for all windows that you might open.Rest of the code you have should wor as is
effisk
08-15-2003, 10:05 AM
I must be thick I didn't get what you said. :(
So, in a desperate move and in last resort,
I plainly removed image from the script,
just in case, you never know, and wonder...
IT WORKED !!! I can have several popups !!!!! :) :D
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.