turpentyne
03-01-2012, 01:20 AM
I don't know how to work with timeouts. I have a simple blinking image. but I'm not sure how to set multiple timeouts?
Basically I want the image to blink to another one for 400, then return to the first image for 5000
here's the basic starting point I have:
<script type="text/javascript">
var img_off = new Image(); img_off.src = 'images/blink.png';
var img_on = new Image(); img_on.src = 'images/orho2.png';
function blink() {
var e = document.getElementById("blinking_orho");
e.src = (e.src == img_on.src) ? img_off.src : img_on.src;
setTimeout("blink();", 5000,);
}
</script>
Basically I want the image to blink to another one for 400, then return to the first image for 5000
here's the basic starting point I have:
<script type="text/javascript">
var img_off = new Image(); img_off.src = 'images/blink.png';
var img_on = new Image(); img_on.src = 'images/orho2.png';
function blink() {
var e = document.getElementById("blinking_orho");
e.src = (e.src == img_on.src) ? img_off.src : img_on.src;
setTimeout("blink();", 5000,);
}
</script>