PDA

View Full Version : Help with photo album script V2.0



phpboy
05-03-2007, 09:46 PM
http://www.dynamicdrive.com/dynamicindex4/photoalbum.htm

Hello Everyone, I have a problem with this particular script, and I don't know what is wrong with it. I am new to javascript, and would appreciate help from anyone.

My problems:
My confuse with this, I think, is where the jpg files are kept, and how do I get the Array to recognize it and load them. for example,

var myvacation=new Array()
myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"}

how would this script locate the jpgs?

I keep the jpg's in a folder called img.

also, I get error in the server's error log stating that the +imgparts[2]+ can not be found

please help

thanks

thetestingsite
05-04-2007, 03:38 AM
where [are] the jpg files kept, and how do I get the Array to recognize it and load them. for example,



var myvacation=new Array()
myvacation[0]=["../photo1.jpg", "", "photo1-large.jpg"}


how would this script locate the jpgs?

I keep the jpg's in a folder called img.


In the above code, the first item in the array ("../photo1.jpg") is where the image is located. If you keep your images in the "img" directory, the you would want to change the path to match your site:



var myvacation=new Array()
myvacation[0]=["img/photo1.jpg", "", "photo1-large.jpg"}


The second (, third, and fourth) item(s) in the Array are all optional. The second item is the title of the image (if you want to define one). The third item is the link destination (where you want the user to be redirected to when they click the image [if any]). The last item is the link target ("_blank", "myFrame", etc).

If you wanted to get this done dynamically using PHP, you should look into using the PHP Photo Album Script (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm).


Hope this helps.