PDA

View Full Version : Image Thumbnail Viewer II question



craban
10-25-2005, 06:21 PM
Script: Image Thumbnail Viewer II
http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

Is it possible to put the array (or most of the <head> script) in a seperate html or something similar as a .JS file

//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["photo1.jpg", "http://www.cnn.com"]
dynimages[1]=["photo2.jpg", "http://www.yahoo.com"]
dynimages[2]=["photo3.jpg", "http://www.google.com"]

regards
-craban

ddadmin
10-26-2005, 06:49 AM
Certainly. The entire code of Step 1 can be inserted in an external .js file. Then you'd reference it on your page as such:


<script src="thumbnail.js" type="text/javascript">

/***********************************************
* Image Thumbnail Viewer II script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>

Attached is how "thumbnail.js" would look like.

craban
10-27-2005, 12:42 PM
Thanks DDAdmin

craban