日期:2014-05-17 浏览次数:20640 次
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="js/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="js/jquery.jplayer.min.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function () { $("#jquery_jplayer_1").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { mp3: "music/test.mp3" }).jPlayer("play"); }, ended: function (event) { $(this).jPlayer("play"); }, swfPath: "js", supplied: "mp3" }); $('#mute').click(function () { if ($(this).hasClass('mute_on')) { $('#jquery_jplayer_1').jPlayer('volume', 1); $(this).removeClass('mute_on').addClass('mute_off'); $('#unmute').removeClass('unmute_off').addClass('unmute_on'); } }); $('#unmute').click(function () { if ($(this).hasClass('unmute_on')) { $('#jquery_jplayer_1').jPlayer('volume', 0); $(this).removeClass('unmute_on').addClass('unmute_off'); $('#mute').removeClass('mute_off').addClass('mute_on'); } }); }); //]]> </script> </head> <body> <form id="form1" runat="server"> <div> <a href="#" id="unmute" >close</a> <a href="#" id="mute">open</a> </div> </form> </body> </html>