Hi,
I am new to JavaScript and have coded a little galley script. But need help improving it.
Currently it will just load images in the current folder, assuming they are all numbered 1..2..3..4 ..ect. with accompanying thumbnails. The code it put into a HTML file.
I would like to improve it so its a JS file rather than included in the HTML. The JS file will then need to take parameters, or read the appropriate information from a file.
Parameters it will need to take are folder of images and number of images.
Ill give some points for anyone who can help.
Thanks.
I am new to JavaScript and have coded a little galley script. But need help improving it.
Currently it will just load images in the current folder, assuming they are all numbered 1..2..3..4 ..ect. with accompanying thumbnails. The code it put into a HTML file.
| Code: |
|
numberpics = 77; var i = 0; var temp1; var temp2; var tempstring; var colls = 4; var remainder; document.write('<p align="center"> <DIV> '); do { i+=1; temp1 = "<A HREF=\"" + i + ".jpg" + "\" onClick=\"window.open(\'" + i + ".jpg" + "\', \'review\'); return false\">" temp2 = "<IMG SRC=" + i + "_tn.jpg> </A>"; tempstring = temp1+temp2; document.write(tempstring); remainder = i%colls; if(remainder==0) { document.write(' </DIV></p>'); } //alert(i); //alert(remainder); } while (i < numberpics); |
I would like to improve it so its a JS file rather than included in the HTML. The JS file will then need to take parameters, or read the appropriate information from a file.
Parameters it will need to take are folder of images and number of images.
Ill give some points for anyone who can help.
Thanks.
