468,161 Members | 1,983 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

Scrolling images with paragraph

Hi,
I'm found a JS to have a series of scrolling images, and have it working.

But I would like to add a paragraph below each image that also changes with each specific image.

Can this be done?
Below is the script.

Thanks for your help
Can

[HTML]<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="images/img4.jpg"
var image2=new Image()
image2.src="images/img7.jpg"
var image3=new Image()
image3.src="images/img5.jpg"
var image4=new Image()
image4.src="images/rr4.jpg"
var image5=new Image()
image5.src="images/rr7.jpg"
var image6=new Image()
image6.src="images/img2.jpg"
//-->
</script>
</head>
<body>
<img src="images/img4.jpg" name="slide" width=280 height=250 />
<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.0 seconds
setTimeout("slideit()",2000)
}
slideit()
//-->
</script>
</body>[/HTML]
Oct 25 '07 #1
1 1797
acoder
16,027 Expert Mod 8TB
Store the paragraphs in array and access them using the same variable that you use for the images.
Oct 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Giuseppe Dini | last post: by
7 posts views Thread by bbxrider | last post: by
3 posts views Thread by Justin England | last post: by
1 post views Thread by bealoid | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.