I am new to javascript/jquery and am trying to make a website that has 3 images on it. Each of these images when clicked will open a slideshow in the middle of the page with next and back buttons. So far I can have one slideshow on a page that is automatically loaded when you open the site and is scrolling through the images. Any help?
So far:
in the head section:
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="images/gallery/of1_thumb.jpg"
var image2=new Image()
image2.src="images/gallery/of2_thumb.jpg"
var image3=new Image()
image3.src="images/gallery/of3_thumb.jpg"
var image4=new Image()
image4.src="images/gallery/of4_thumb.jpg"
var image5=new Image()
image5.src="images/gallery/of5_thumb.jpg"
var image6=new Image()
image6.src="images/gallery/of6_thumb.jpg"
//-->
</script>
in the body:
<img src="images/gallery/of1.jpg" name="slide">
<script type="text/javascript">
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<6)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
Having multiple slideshows on one page that open on click
The following script has three boxes (1,2,3). If you click on one of them the image below will start counting at that number. The bottom image also has a left and right button. If you click the left button the count goes backwards, the right button moves the count forwards.
The numbered images are for illustrative purposes only. You can substitute them for any other image you want. All images are preloaded on opening the page.