jQuery网页播放声音

  1. <html>
  2. <head>
  3. <title>sound test</title>
  4. <scripttype="text/javascript"src="js/jquery.js"></script>
  5. <scripttype="text/javascript">
  6. $(function(){
  7. $('a.click').click(function(){
  8. $('embed').remove();
  9. $('body').append('<embed src="notify.wav" autostart="true" hidden="true" loop="false">');
  10. });
  11. $('a.hover').mouseover(function(){
  12. $('embed').remove();
  13. $('body').append('<embed src="notify.wav" autostart="true" hidden="true" loop="false">');
  14. });
  15. });
  16. </script>
  17. </head>
  18. <body>
  19. <p><ahref="#"class="click">点击后发声提示</a></p>
  20. <p><ahref="#"class="hover">鼠标在上面发声提示</a></p>
  21. </body>
  22. </html>
posted @ 2014-03-16 12:07  Tsy_blog  阅读(787)  评论(0)    收藏  举报