Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1645 How can I make an image blink on and off a specified number of times?

You are here: irt.org | FAQ | JavaScript | Image | Q1645 [ previous next ]

Try:

<script language="JavaScript"><!--
var onOrOff= 'on';
var rate = 500; // blinks every half second

function blinkImage() {
   if (onOrOff == 'on') onOrOff = 'off';
   document.images['myImage'].src = 'myimage' + onOrOff + '.gif';
   times--;
   if (times <= 0) return;
   setTimeout('blinkImage()',rate);
}

var times = 3;
setTimeout('blinkImage()',rate);
//--></script>

Feedback on 'Q1645 How can I make an image blink on and off a specified number of times?'

©2018 Martin Webb