|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm trying to do a slideshow of several images. I've got the code below working, but it recycles after the first few and doesn't go through all 10 in the slides directory. Also, it doesn't want to work with any image that isn't the same H and W.
-------- hope this pastes ok -------- <html> <head> <script type="text/javascript" language="JavaScript"> var counter = 0; var images = new Array(); var links = new Array(); for (var i = 0; i < 5; i++) { images [i] = new Image(); images [i].src = "slides/photo"+ i + ".gif"; links [i] = "slide"+i+".html"; } //Animate Slideshow function show_slides(){ document.slideshow.src = images[counter].src imagenum=counter; counter = (counter > 3 ? 0 : ++counter); setTimeout("show_slides()", 2800); } </script> <title>test</title> </head> <body> <p align="CENTER"><a href="javascript:image_link()"><img src="slides/photo0.gif" name="slideshow" border="0"> </a></p> <script type="text/javascript" language="JavaScript"> function image_link(){ window.location = links[imagenum]; } </script> </body> </html> |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > simple newbie slideshow code ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|