fubar0021
02-02-2004, 08:50 PM
I have a basic thumbnail viewer that when an image is clicked it pops up in a new window full size. I want a description to appear along with the image, but because of the number of images i have i want to try and use a variable string with the description as part of the "onClick" for each image. How would i set this up? Any help would be appreciated. The popup script is:
<script language="JavaScript1.2">
<!--
function openWin(winHeight,winWidth,picSrc){
newWin = window.open('', '', 'height='+ winHeight + ',width='+ winWidth + 'toolbars=no, scrollbars=NO' );
newWin.document.write("<HEAD><TITLE>IMAGE VIEWER</TITLE></HEAD>");
newWin.document.write("<BODY BGCOLOR=BLACK BACKGROUND='pics/webbackgroundtile.jpg'>");
newWin.document.write("<P ALIGN=CENTER>");
newWin.document.write("<TABLE COL=2 WIDTH=80% ALIGN=CENTER BORDER=2><TR><TD><IMG SRC="+ picSrc +"></TD><TD>"+ description +"</TD></TR></TABLE>");
newWin.document.write("<BR><BR><BR><FORM><input type='button' value='Close' onclick='JavaScript:window.close()'>");
newWin.document.write("</FORM></P>");
newWin.document.write("</BODY>");
}
-->
</script>
<script language="JavaScript1.2">
<!--
function openWin(winHeight,winWidth,picSrc){
newWin = window.open('', '', 'height='+ winHeight + ',width='+ winWidth + 'toolbars=no, scrollbars=NO' );
newWin.document.write("<HEAD><TITLE>IMAGE VIEWER</TITLE></HEAD>");
newWin.document.write("<BODY BGCOLOR=BLACK BACKGROUND='pics/webbackgroundtile.jpg'>");
newWin.document.write("<P ALIGN=CENTER>");
newWin.document.write("<TABLE COL=2 WIDTH=80% ALIGN=CENTER BORDER=2><TR><TD><IMG SRC="+ picSrc +"></TD><TD>"+ description +"</TD></TR></TABLE>");
newWin.document.write("<BR><BR><BR><FORM><input type='button' value='Close' onclick='JavaScript:window.close()'>");
newWin.document.write("</FORM></P>");
newWin.document.write("</BODY>");
}
-->
</script>