js事件 ,播放声音:
html:
<html> <body> <div id="voice"> </div> </body> </html>
js:
比如在某个点击事件里写:
playVoice(/voices/test.mp3);
function playVoice(file) { $('#voice').html('<audio controls="controls" id="audio_player" style="display:none;"> <source src="' + file + '" > </audio><embed id="MPlayer_Alert" src="' + file + '" loop="false" width="0px" height="0px" /></embed>'); }
转载请注明原文地址: https://ju.6miu.com/read-965678.html