View Full Version : Preloaded slideshow script

06-03-2005, 01:35 PM
I wanted to see how I could add an image button instead of the arrow form element to this slideshow. When I go to change the input type as an image and add the image file, the slideshow doesn't work. Help.

Here is the link to the script:http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm

06-03-2005, 02:45 PM
<td><input type="button" name="Previous"
value="" style="background:silver url('prev.gif') no-repeat center;width:2em;" onClick="ShowSlide(-1)"></td>
<td align="right"><input type="button" name="Next"
value="" style="background:silver url('next.gif') no-repeat center;width:2em;" onClick="ShowSlide(1)"></td>

06-03-2005, 03:27 PM
Thank you!

Is there a way just to use an image that I made that already looks like a button instead of filling in a button? I wanted a round button, that's why.

06-03-2005, 07:27 PM
I played around with the script a bit before coming up with the solution I offered above. I was able to get as far as using one image input but, the script refused to accept two image inputs, even with changing the script's code. It was as though the browser wouldn't accept them as part of the form. We could mod the script further and dispense with the form altogether, allowing any link (images included) to act as buttons, this will require flags to disable the buttons at the appropriate times. I'll look into it.

06-03-2005, 07:55 PM
Almost easier done than said. Remove this from the script:
document.SlideShow.Previous.disabled = (NextSlide == 0);
document.SlideShow.Next.disabled = (NextSlide ==
(Slides.length-1)); Then you can use this format for the controls:
<td><input type="image" name="Previous" src="prev.gif" onClick="ShowSlide(-1);return false"></td>
<td align="right"><input type="image" name="Next" src="next.gif" onClick="ShowSlide(1);return false"></td>No need to get rid of the form after all.

06-07-2005, 05:23 PM
Thank you so much. That's awesome! :)