積極傾聽並將jqueryui-slider
與jplayer voulme
合併爲一個值變量?還顯示在另一個div的音量值? 是否有辦法獲取jqueryui slider
val的值並將其應用於jplayer
vololume的值? HTML標記:jqueryui滑塊+ jplayer音量值
<ul class="toolbar ui-widget-header ui-corner-all">
<li><button class="jp-play" href="#">Play</button></li>
<li><button class="jp-pause" href="#">Pause</button></li>
<li><button class="jp-stop" href="#">Stop</button></li>
<li><button class="jp-mute" href="#">Mute</button></li>
<li><button class="jp-unmute" href="#">Unmute</button></li>
<li><div class="jp-volume-bar"></div></li>
</ul>
<ul>
</ul>
的jQuery:
my_jPlayer.jPlayer({
ready: function() {
$("#jp_container .track-default").click();
},
timeupdate: function(event) {
my_extraPlayInfo.text(parseInt(event.jPlayer.status.currentPercentAbsolute, 10) + "%");
},
play: function(event) {
my_playState.text(opt_text_playing);
},
pause: function(event) {
my_playState.text(opt_text_selected);
},
ended: function(event) {
my_playState.text(opt_text_selected);
},
swfPath: "js",
cssSelectorAncestor: "#jp_container",
supplied: "mp3",
wmode: "window",
volumeBarValue: volVal
});
$(".jp-volume-bar").slider({
value: 100,
orientation: "horizontal",
range: "min",
animate: true
});
var volVal = $(".jp-volume-bar").slider("value");
這將給我一個整數,我需要一個浮點數最小0到最大1 ...有沒有辦法獲得一個浮點值? – 2012-03-04 10:06:44
http://stackoverflow.com/questions/4057489/javascript-convert-int-to-float – ShaggyInjun 2012-03-05 03:48:34