I am working on wordpress site. In this site i need to play sounds on mouseover, everything is well, but something is wrong, and I dont know why?
There is delay when mouseover on the button.
please check the link http://barkingspidertheatre.com.au/new/
here is my code
JavaScript
function doPlay(what){
document.getElementById('music').innerHTML='<object type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3_mini.swf?autoplay=1" width="200" height="20">'
+'<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_mini.swf?autoplay=1" />'
+'<param name="bgcolor" value="#000000" />'
+'<param name="autoplay" value="1" />'
+'<param name="FlashVars" value="mp3='+what+'" />'
+'</object>';
}
function doStop(){
document.getElementById('music').innerHTML='';
}
HTML
<a href="<?php bloginfo("url");?>/roving-butterflies-penelope-ulysses/?ajax=true&width=108%&height=105%" rel="prettyPhoto[ajax]" onMouseMove="javascript:doPlay('<?php bloginfo('template_url'); ?>/songs/Harp_gliss_wind_chimes_short_BLASTWAVEFX_15022.mp3')" onMouseOut="doStop();">
<div class="music_player" id="music"></div>
Can any one tell me how can i remove delay on mousover play sound.
Thanks
with html5 you can access the
audio apidirectly, you can do something like below instead of creating object tag for playing the sound:hope it helps.