Home|Sitemap|Contact

How can you ?


Mouseover: Sound 1Sound 2Sound 3


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005, 2006 Roderick Divilbiss">
<title>How to play a WAV file on mouseover</title>

<script type="text/javascript">
<!-- 
function playSound(sndId) {
    var sndObj=document.getElementById(sndId);
    try {
        sndObj.Play();
    }
    catch (e) {
        sndObj.DoPlay();
    }
}
-->
//-->
</script>
</head>

<body>
<div>
Mouseover: <span onmouseover="playSound('snd0');">Sound 1</span> |&nbsp; <span onmouseover="playSound('snd1');">Sound 2</span> |&nbsp; <span onmouseover="playSound('snd2');">Sound 3</span>
</div>
<embed id="snd0" src="/ee/newalert.wav" autostart="false" hidden="true" enablejavascript="true">
<embed id="snd1" src="/ee/type.wav" autostart="false" hidden="true" enablejavascript="true">
<embed id="snd2" src="/ee/xpinfbar.wav" autostart="false" hidden="true" enablejavascript="true">
</body>
</html>