Yankman30 Posted August 16, 2005 Posted August 16, 2005 Hi, I've created a photo gallery using Swap Image so all the photos and their related thumbnails are on the same page. I would like to have a Next and Previous button which would go the next or previous full sized photo. I've been looking but can't find any tutorials or ideas. Is this possible to do with just Dreamweaver? Thanks for any help! Quote
abinidi Posted August 17, 2005 Posted August 17, 2005 Well, I don't think it is going to be possible with the out-of-box stuff in Dreamweaver. You could use javaScript to accomplish what you are trying to do, but I don't know that there is a javaScript pre-built that is going to do that for you. It would work best if your images were numbered sequentially. Then you would load the first image as full-sized, and you would set a variable that said which image number you were retrieving. Then you would define a function on the next and previous buttons that would increase the variable by one (or decrease the variable by one), and you would use the variable in the filename for the image called by the next and previous button functions. You would have to set a maximum number to your variable (equal to the number of pictures you have) so that you can create a loop. You would probably do this by having your add/subtract function check to see what the current variable is. For the add function, if the variable is < the total number of images, then you should add one. If the variable is = the total number of images, then you would reset the variable to 1. The subtract function would be the opposite. My javaScript skills are a bit rusty, but this should give you an overview of what you are trying to accomplish. I think it should be pretty simple, in terms of javaScript complexity. Quote
Yankman30 Posted August 17, 2005 Author Posted August 17, 2005 Your javaScript skills may be rusty but mine are nonexistent! I was thinking some type of sequence script would be required. Do you know of any tutorials or what type of google search I should do? So far, I haven't come up with anything. Thanks for replying! Quote
abinidi Posted August 17, 2005 Posted August 17, 2005 I did a search on "javascript image slideshow" and I saw a variety of scripts that might help get you started. If you find something that you like there, then may I suggest that you try modifying that script for your site, and then when you encouter problems, you can post a question in the Scripting Talk forum. Somebody there is sure to be able to help you work out the errors in your script. (Somebody whose javaScript skills are less rusty than mine! ) Best wishes, Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.