create multiple slide shows in a single webpage using html and javascript with different timings

This is sample coding to create two slide show in a same page with different timings

var image1=new Image()
image1.src=”sample/images/black-berry.jpg”
var image2=new Image()
image2.src=”sample/images/i-Mate.jpg”
var image3=new Image()
image3.src=”sample/images/lg.jpg”
var test1=new Image()
test1.src=”sample/images/nokia1.jpg”
var test2=new Image()
test2.src=”sample/images/nokia2.jpg”
var test3=new Image()
test3.src=”sample/images/nokia1.jpg”


//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<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
function slideit1(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slideshow.src=eval("test"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit1()" every 3 seconds
setTimeout("slideit1()",3000)
}
slideit()
slideit1()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s