Click to See Complete Forum and Search --> : multiple picture pop-up trouble (1 at a time)


hecate8176
08-17-2003, 01:33 PM
First off I'd like to say I'm a beginner, bare with me pls.

This is the site I'm learning/building/creating on.
http://www.geocities.com/hecate8176/finalindex.html

The Photos page is giving me trouble. What I am trying to accomplish is a page with thumbnails that when you click on it (a thumbnail), it opens a pop-up to the larger version. My trouble is that the pop-up is ALWAYS the last picture I coded no matter what thumbnail you click on. Im getting extremely fustrated. Here is the code:

<SCRIPT LANGUAGE="JavaScript">
function popjack()
{
window.open('abc.html','popjack','toolbar=no,location=no,directories=no,status=no,menubar=no,resizab le=yes,copyhistory=no,scrollbars=no,width=700,height=700');
}
</script>
<a href="javascript: popjack()" onMouseOver="window.status='Status Bar Message'; return true" onMouseOut="window.status="; return true">
<IMG SRC="images/tnlizbabe1.jpg" WIDTH="50" HEIGHT="56" ALT="click to see larger picture" border="0"></a>

<SCRIPT LANGUAGE="JavaScript">
function popjack()
{
window.open('fire.html','popjack','toolbar=no,location=no,directories=no,status=no,menubar=no,resiza ble=yes,copyhistory=no,scrollbars=no,width=350,height=550');
}
</script>
<a href="javascript: popjack()" onMouseOver="window.status='Status Bar Message'; return true" onMouseOut="window.status="; return true">
<IMG SRC="images/tnfire.jpg" WIDTH="50" HEIGHT="51" ALT="click to see larger picture" border="0"></a>

Khalid Ali
08-17-2003, 01:41 PM
It seems like you have a script for each image(if its true then its wrong..:D).

use the following code to help you understand the concept

<SCRIPT LANGUAGE="JavaScript">
function popjack(url)
{
window.open(url,'popjack','toolbar=no,location=no,directorie
s=no,status=no,menubar=no,resizable=yes,copyhistor
y=no,scrollbars=no,width=350,height=550');
}
</script>
<IMG SRC="images/tnfire.jpg" WIDTH="50" HEIGHT="51" ALT="click to see larger picture" border="0" onclick="popjack(this.src)">

the code above should take the resource image of the image that triggers the onclickevent and pass it to the function that opens the larger image.And that functions should open the image

Fang
08-17-2003, 01:58 PM
A general solution:

<script type="text/javascript">
<!--
function popjack(obj) {
var str="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=n o,width="+obj.width+",height="+obj.height;
window. open(obj.scr,'popjack',str);
}
//-->
</script>
<IMG SRC="images/tnfire.jpg" WIDTH="50" HEIGHT="51" ALT="click to see larger picture" border="0" onclick="popjack(this)">

hecate8176
08-17-2003, 02:06 PM
Ok I tried this:
<SCRIPT LANGUAGE="JavaScript">
function popjack(abc.html)
{
window. open(abc.html,'popjack','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,co pyhistory=no,scrollbars=no,width=350,height=550');
}
</script>
<IMG SRC="images/tnlizbabe1.jpg" WIDTH="50" HEIGHT="51" ALT="click to see larger picture" border="0" onclick="popjack(this.src)">

but in the status bar it said "error on page".

Question, I did have a script for each image, so was this script supposed to be for all the images I want to pop-up? Do I just add this tag <IMG SRC="URL" WIDTH="50" HEIGHT="51" ALT="click to see larger picture" border="0" onclick="popjack(this.src)"> for each image??

Fang
08-17-2003, 02:13 PM
Just use the code I adapted from Khalid Ali's code.
You only need the one function.