Slide Show2. Obtain the Script |
|
Join the DiscussionMore of this FeatureTo make a slide show for your web page you need to copy the following script and attach it to the head section of your page.
var imgs = new Array(); var imgcnt = 0; var thisimg
= 0;
imgs[imgcnt++] = 'graphics\/pic1a.gif'; imgs[imgcnt++] = 'graphics\/pic2a.gif'; imgs[imgcnt++] = 'graphics\/pic3a.gif'; function nextImg() { if (document.images) { thisimg++; if (thisimg >= imgcnt) thisimg = 0; document.rollimg.src = imgs[thisimg]; } } function prevImg() { if (document.images) { thisimg--; if (thisimg < 0) thisimg = imgcnt-1; document.rollimg.src = imgs[thisimg]; } } The code shown in bold should be kept exactly as shown In my example, I have three images so I need three sets of lines to define three images. You just need to specify as many separate entries as you need for your particular setup. Once you have created your code you just save it to an external javascript file. I called mine img2.js. You then link it into the head of your page using the following code:
<script type="text/javascript"
src="img2.js">
</script> Now all that remains is to add the images to your page.
Sample Page | Obtain the
Script | Add to Your Page
|

