我目前正在使用jPlayer將一些聲音片段添加到我的網站,但是當我點擊播放時,沒有任何反應......網頁只是重新加載,就好像我點擊了一個鏈接,下面是我的HTML和我的JavaScript,也是改變的DOM。jplayer點擊播放什麼都沒有發生
$("#jquery_jplayer").jPlayer({
ready: function (event) {
$('.voice').click(function(e) {
$(this).jPlayer("setFile", $(this).attr('rel')).jPlayer("play");
e.preventDefault();
});
},
solution: "flash, html", // Flash with an HTML5 fallback.
swfPath: "/media/js/jPlayer/",
wmode: "window"
});
});
<li><a href="" rel="<?php echo base_url(); ?>media/uploads/audio/<?php echo $candidate_audio['url']; ?>" class="voice">Play Voice Over</a></li>
的閃光燈保持
<div id="jquery_jplayer"></div>
改變上domready中太....
<div id="jquery_jplayer" style="width: 0px; height: 0px;">
<img id="jp_poster_0" style="width: 0px; height: 0px; display: none;">
<object width="1" height="1" id="jp_flash_0" data="/media/js/jPlayer/Jplayer.swf" type="application/x-shockwave-flash" style="width: 0px; height: 0px;">
<param name="flashvars" value="jQuery=jQuery&id=jquery_jplayer&vol=0.8&muted=false">
<param name="allowscriptaccess" value="always">
<param name="bgcolor" value="#000000">
<param name="wmode" value="window">
</object>
</div>