changing picture

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

Guest

On FP2000, I designed a web component that had 2 pictures of a
jack-in-the-pulpit wildflower, one open and one closed. The picture would
change from one to the other every few seconds, and look like the flower was
opening and closing. I do not remember how I did this... I am using FP2003
now. Thanks! kat
 
Harry, thanks for the response - that is what I want to do, but I did it in
FP2000 without a download. It seems like I changed a banner or marquis to
fit the dimensions I wanted , added the pictures and set the time I wanted
them to change. I just can't seem to find what I used. Thank you again, kat
 
Kat,

This can be done using setinterval in javascript. Every x seconds it
executes a function which can be set to swap the pictures back and forth.

I can give more help when I think about it some more.
 
Kat,

This is the code to swap 2 pictures every second
<html>
<head>
<script type="text/javascript">
var swapped = false,
delay = 1000 , run ,
pic1 = "images/1.jpg" ,
pic2 = "images/2.jpg"

function change()
{
document.getElementById('picture').src= (!swapped)?pic2:pic1
swapped = !swapped
}
function doit()
{
if (!swapped)
run = setInterval("change()",delay)
else
window.clearInterval(run)
}
</script>
</head>
<body onload="doit()">
<img src="" id= "picture" alt="">
</body>
</html>

I have tested it and it works, but
You need to alter the value of delay to the number of seconds you want
(*1000)
and the names of pic1 and pic2
You also need to position the picture in the HTML to where you want it

Good luck
 
Back
Top