http://www.dynamicdrive.com/dynamici...criptsound.htm
That's for IE only. I devised a script that works in Mozilla as well:
Code:
<html>
<head>
<title>Cross Browser Sound - Demo</title>
<style type="text/css">
.snd {
height:0;
width:0;
position:absolute;
top:0;
left:0
}
</style>
<script type="text/javascript">
/*Cross Browser Sound Script
Copyright © John Davenport Scheuer
Permission granted for use
This credit must stay intact*/
//////////No need to Edit Script/////////
function e_sound(soundobj) {
if((!document.all)&&(document.getElementById)){
var thissound= eval("document."+soundobj);
thissound.Play();
}
else if(document.all){
var a=eval("document.all."+soundobj+".src");
document.all.sound.src=a;
}
else
return;
}
</script>
</head>
<body onfocus="if(document.all)document.all.sound.src=''">
<bgsound id="sound">
<!--edit below embeds to add different SRC sounds or add more,
use a unique name for each embed-->
<embed class="snd" NAME="chm" SRC="chimes.wav" AUTOSTART="false" loop="false" HIDDEN="true">
<embed class="snd" NAME="dng" SRC="ding.mp3" AUTOSTART="false" loop="false" HIDDEN="true">
<embed class="snd" NAME="thp" SRC="thup.wav" AUTOSTART="false" loop="false" HIDDEN="true">
<!--use with any element that supports onMouseOver, onMouseOut or onClick events-->
<span onmouseOver="e_sound('chm')" onmouseOut="e_sound('dng')">Mouse Over This for Chime, Mouse Out for Ding</span>
<br><a href=// onmouseOver=e_sound('thp')>Thup!</a>
</body>
</html>
Bookmarks