jquery-ui-slider

Trigger a jQuery UI slider event

≡放荡痞女 提交于 2019-11-26 15:57:31
问题 How can I trigger a change event on a jQuery UI slider? I thought it would be $('#slider').trigger('slidechange'); but that does nothing. Full example script follows: <link href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" type="text/css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> <script src="http://jqueryui.com/latest/ui/ui.core.js" type="text/javascript"></script> <script src="http://jqueryui.com

How to get value from jQuery UI slider?

拟墨画扇 提交于 2019-11-26 14:19:05
问题 I am working on http://gamercity.info/ymusic/. And I am using UI slider as seek bar. While the video is played I want to invoke a seekTo(seconds) function if user clicked anywhere on the seek bar. How to get new value of seconds after click event? 回答1: To read slider value/percentage value at anytime: var val = $('#slider').slider("option", "value"); 回答2: $('#slider').slider({ change: function(event, ui) { alert(ui.value); } });​ http://jqueryui.com/demos/slider/ 回答3: var val = $("#slider")

Using jQuery to control HTML5 <audio> volume

好久不见. 提交于 2019-11-26 09:57:44
问题 Okay, I want to control the volume of an HTML5 element using the jQuery Slider element. I have implemented the slide, but can\'t figure out how to make the value of the slider take the place of the \"audio player.volume = ?\". Any help is much appreciated. Source 回答1: The volume property is like opacity, it goes between zero and one, one being 100%. Your code is so close, you just need to divide value by 100 when setting the volume of the <audio> element: $("#slider").slider({ value : 75,