ignore document.onkeyup events for set a period?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

ignore document.onkeyup events for set a period?

From: <paul.sherwood@gmail.com>
Date: Fri Jan 27 2006 - 17:26:29 CET

Hi

Ive made a game for babies that simply displays one of an array of
pictures of animals along with there sound each time the keyboard is
'bashed'.

at the moment i dynamically load pictures using

<img id="image" src="somepic.gif" alt="" border=0px/>
<script type="text/javascript">
document.onkeyup=changeImageSrc;
</script>

and

function changeImageSrc(){
.
.
document.getElementById('image').src = nextImage; //nextImage is
already loaded from the image array
}

This works great for adults. However babies dont tend to wait for the
image and sound to have played before bashing again, so lots of keyup
events come along and the page ends up being a blur of images and
sounds. How might i best remedy this issue?

thanks in advance

Paul
Received on Tue Feb 7 21:25:13 2006