Saturday, June 22, 2013

when mouseout starts from begieningl

<p onmouseover="PlaySound('mySound')"
    onmouseout="StopSound('mySound')">Hover Over Me To Play</p>

<audio id='mySound' src='5.mp3'/>
<script type="text/javascript">
function PlaySound(soundobj) {
    var thissound=document.getElementById(soundobj);
    thissound.play();
}

function StopSound(soundobj) {
    var thissound=document.getElementById(soundobj);
    thissound.pause();
    thissound.currentTime = 0;
}
</script>

mouseover sounds by using jquey

<audio id="mysound1" src="12.mp3"></audio>
                    <div onmouseover="document.getElementById('mysound1').play()" onmouseout="document.getElementById('mysound1').pause()" class="service-box-2-container">