gpt4 book ai didi

jqueryui slider +jplayer音量值

转载 作者:行者123 更新时间:2023-12-01 07:26:01 24 4
gpt4 key购买 nike

主动监听并将 jqueryui-sliderjplayer voulme 组合在值变量中?还在另一个div中显示音量值?有没有办法获取 jqueryui slider val 的值并将其应用于 jplayer vaolume 的值?html 标记:

<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");

最佳答案

使用最新的 jplayer(版本:2.1.0)这真的非常容易:

$('#sliderVolume').slider({
value : 50,
max: 100,
range: 'min',
animate: true,
orientation: "vertical",

slide: function(event, ui) {
var volume = ui.value / 100;
$("#jquery_jplayer").jPlayer("volume", volume);
}
});

关于jqueryui slider +jplayer音量值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9553858/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com