Hi. If anyone can help me with this, I'd be much appreciative. Basically, I have a gallery of images, thumbnailed inside of a table. I want the user to be able to click on the thumbnail, and a new window that's the size of the image pops up to view the image. Anyway, I found a script that does it for me just fine. The problem is, I don't know what all the variables mean! So I can't really customize anything since I don't understand what changes what. Here is the script I found:
<SCRIPT language=JavaScript>
var width,height
var image,ext
var cond1,cond2
function transferview(image,width,height) {
if (width==0) cond1=" "
else cond1="width="+(width+50)+"";
if (height==0) {cond2=" "};
else {cond2="height="+(height+70)+""};
var s1 ="<TITLE>Image</TITLE>"
var s15=""
var s2 ="<CENTER><IMG SRC='http://www.webdeveloper.com/forum/archive/index.php/"+image+"' BORDER=0>"
var s3 ="<FORM><INPUT TYPE='BUTTON' VALUE='http://www.webdeveloper.com/forum/archive/index.php/Close Window'"+ " onClick='self.close()'>"
var s4 ="</FORM></center>"
ImageWindow=window.open("", "newwin"+width,"toolbar=no,scrollbars="+scroll+",menubar=no,"+cond1+","+cond2+");
ImageWindow.document.write(s1+s15+s2+s3+s4)
ImageWindow.document.close()
}
</SCRIPT>
...then, inside the <a href> tag, you insert the following:
javascript:transferview('photo02.jpg',577,630)
...where the 577,630 is the size of the image.
Can anyone help me to understand all those crazy variables, etc, in the script? I'd like to know how to customize the Close Window button, or take it out completely, or change the border, or take out the border, etc.
Tonnnnns of appreciation to anyone who can give me a quick explanation!
<SCRIPT language=JavaScript>
var width,height
var image,ext
var cond1,cond2
function transferview(image,width,height) {
if (width==0) cond1=" "
else cond1="width="+(width+50)+"";
if (height==0) {cond2=" "};
else {cond2="height="+(height+70)+""};
var s1 ="<TITLE>Image</TITLE>"
var s15=""
var s2 ="<CENTER><IMG SRC='http://www.webdeveloper.com/forum/archive/index.php/"+image+"' BORDER=0>"
var s3 ="<FORM><INPUT TYPE='BUTTON' VALUE='http://www.webdeveloper.com/forum/archive/index.php/Close Window'"+ " onClick='self.close()'>"
var s4 ="</FORM></center>"
ImageWindow=window.open("", "newwin"+width,"toolbar=no,scrollbars="+scroll+",menubar=no,"+cond1+","+cond2+");
ImageWindow.document.write(s1+s15+s2+s3+s4)
ImageWindow.document.close()
}
</SCRIPT>
...then, inside the <a href> tag, you insert the following:
javascript:transferview('photo02.jpg',577,630)
...where the 577,630 is the size of the image.
Can anyone help me to understand all those crazy variables, etc, in the script? I'd like to know how to customize the Close Window button, or take it out completely, or change the border, or take out the border, etc.
Tonnnnns of appreciation to anyone who can give me a quick explanation!