HTML Code:
<html>
<head>
<bgsound src="#" id="soundeffect" loop=1 autostart="false" />
<script type="text/javascript">
/***********************************************
* JavaScript Sound effect- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
var soundfile="http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song1.mp3" //path to sound file, or pass in filename directly into playsound()
var soundfile="http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song2.mp3" //path to sound file, or pass in filename directly into playsound()
var soundfile="http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song3.mp3" //path to sound file, or pass in filename directly into playsound()
var soundfile="http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song4.mp3" //path to sound file, or pass in filename directly into playsound()
var soundfile="http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song5.mp3" //path to sound file, or pass in filename directly into playsound()
function playsound(soundfile){
if (document.all && document.getElementById){
document.getElementById("soundeffect").src="" //reset first in case of problems
document.getElementById("soundeffect").src=soundfile
}
}
function bindsound(tag, soundfile, masterElement){
if (!window.event) return
var source=event.srcElement
while (source!=masterElement && source.tagName!="HTML"){
if (source.tagName==tag.toUpperCase()){
playsound(soundfile)
break
}
source=source.parentElement
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>poems test</title>
</head>
<body>
<img src="http://www.bigwood.nottingham.sch.uk/wp-content/uploads/2013/library/sooty.jpg" width="338" height="220" border="0" usemap="#Map" />
<map name="Map" id="Map"><area shape="poly" coords="332,189,313,90,327,42,285,12,249,35,252,80,246,98,235,167,238,203,316,200" onClick="playsound('http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song1.mp3')">
<area shape="poly" coords="213,188,194,89,208,41,166,11,130,34,133,79,127,97,116,166,119,202,197,199" onClick="playsound('http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song2.mp3')">
<area shape="poly" coords="102,194,83,95,97,47,55,17,19,40,22,85,16,103,5,172,8,208,86,205" onClick="playsound('http://www.bigwood.nottingham.sch.uk/VLE/audio_player/song3.mp3')">
</map>
</body>
</html>
but I weant it to stop if I click on a button...
Bookmarks