How to swap pics with time conditions?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Try to swap pictures based on time condition, i.e. an other picture loads
after 10 seconds (replacing the initial picture). Anyone can tell me how to
do that? Thanks.
 
I use this JS code

var lock = false , run
function auto(delay)
{
if (delay == null)
delay = 10000

if (!lock)
{ lock = true
run = setInterval("chgImg(1)",delay) }
else
{ lock = false
window.clearInterval(run)
}
}

var ImgNum = 0;
function chgImg(position)
{
ImgNum += position
document.getElementById('Image').innerHTML =
'<img src=" ' + Slides[ImgNum] + ' " alt=" " >'
}

var Slides = new Array(
"02-06-06-phil-and-michelle.jpg" ,
"02-11-03-melissa.jpg" ,
"04-11-22-kate-and-julie.jpg" ,
"04-01-21-6-adam-on-sprinkler.jpg" ,
"04-01-21-bryan-on-sprinkler.jpg" ,
"04-11-21-2-bryan's-picture.jpg" ,
"05-01-29-michelle-at-kindy.jpg" )

The HTML contains
<span id="Image">...</span><br>
<input type="button" value="Auto"
onclick="auto()">

This code is extracted from stuff whcih works, but in trying to leave out
the detail., I may have omitted something (I hope not!)
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Try to swap pictures based on time condition, i.e. an other picture
loads after 10 seconds (replacing the initial picture). Anyone can
tell me how to do that? Thanks.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top