jquery-ui-slider

jQuery slider “change” event: How do I determine who called it?

徘徊边缘 提交于 2019-11-28 07:36:44
问题 I got a slider that is used as a time-line in my music player. The min value is 0 and the max vlaue is the song length (in seconds). Each second (I do this with a timer), the slider moves and the value is set to the current time. This code line looks like that: $("#sliderTime").slider("option", "value", document.sound.controls.currentPosition); The user is able to slide/click the slider and jump to another point in the song, this is by firing the function 'play(startPlayFromHere)'. It looks

jQuery UI Slider - Value returned from 'slide' event on release is different from 'change' value

本秂侑毒 提交于 2019-11-28 03:14:10
问题 I have a jQuery UI slider: $('div.slider').slider({ range: true, step: 250, min: 1000, max: 500000, values: [1000,500000], change: function(event, ui){ console.log($(this).slider('values', 0)+','+$(this).slider('values', 1)); }, slide: function(event, ui){ console.log($(this).slider('values', 0)+','+$(this).slider('values', 1)); } }); For some odd reason, when releasing the slider (mouseup) the value changes slightly from what it was. The slide event is returning something different than what

jQuery UI slider Touch & Drag/Drop support on Mobile devices

限于喜欢 提交于 2019-11-28 03:07:33
I have already styled and implemented jQuery UI slider into a project. While it is mobile and scales properly, it does not allow tap and drag. Instead you have to touch where you want the slider to go. jQuery mobile UI supports this, but I have time invested into what is already there. The functionality we want: Here What we are using: Here On a desktop you can't tell the difference. On a mobile device it is apparent. Anyone know how to add this support to jquery UI? $("#cameraSlider").slider({ value: 2, min: 1, max: 3, step: 1, slide: function(event, ui) { cameramen = ui.value; return

JQuery UI Slider with Non-linear/Exponential/Logarithmic steps

情到浓时终转凉″ 提交于 2019-11-28 00:26:17
问题 I'm new to Javascript and JQuery, I am trying to use JQuery UI Slider to replace price range dropdown boxes(one for Minimum Price, another for Maximum Price) for one of my sites. Here is my current code: $(function() { var slider = $( "#slider-range" ).slider({ range: true, min: 0, max: 2500000, step: 1000, values: [ 0, 2500000 ], slide: function( event, ui ) { $( "#amount" ).val( "RM " + commafy(ui.values[ 0 ]) + " to RM " + commafy(ui.values[ 1 ]) ); } }); $( "#amount" ).val( "RM " +

Trigger a jQuery UI slider event

*爱你&永不变心* 提交于 2019-11-27 12:17:01
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/latest/ui/ui.slider.js" type="text/javascript"></script> <body> <div id="slider"></div> <script type="text

How to get value from jQuery UI slider?

假装没事ソ 提交于 2019-11-27 08:48:51
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? To read slider value/percentage value at anytime: var val = $('#slider').slider("option", "value"); $('#slider').slider({ change: function(event, ui) { alert(ui.value); } });​ http://jqueryui.com/demos/slider/ var val = $("#slider").slider("value"); I checked all the answers mentioned above, but found none useful as the following code: $('#slider')

ui slider with text box input

六眼飞鱼酱① 提交于 2019-11-27 01:51:52
问题 We have a ui slider we utilise, and it works flawlessly. code: jQuery(function() { jQuery( "#slider-range-min" ).slider({ range: "min", value: 1, step: 1000, min: 0, max: 5000000, slide: function( event, ui ) { jQuery( "#amount" ).val( "$" + ui.value ); } }); jQuery( "#amount" ).val( "$" + $( "#slider-range-min" ).slider( "value" ) ); }); As you can see we allow user to pick anything between 0 and 5,000,000. Html is: <div id="slider-range-min" style="width: 460px; float:left;margin:10px;"><

jQuery UI slider Touch & Drag/Drop support on Mobile devices

﹥>﹥吖頭↗ 提交于 2019-11-26 23:57:17
问题 I have already styled and implemented jQuery UI slider into a project. While it is mobile and scales properly, it does not allow tap and drag. Instead you have to touch where you want the slider to go. jQuery mobile UI supports this, but I have time invested into what is already there. The functionality we want: Here What we are using: Here On a desktop you can't tell the difference. On a mobile device it is apparent. Anyone know how to add this support to jquery UI? $("#cameraSlider").slider

jQuery UI Slider Labels Under Slider

不羁的心 提交于 2019-11-26 22:06:58
I am limited to using jQuery 1.4.2 and jQuery ui 1.8.5 (this is not by choice, please do not ask me to upgrade to latest versions). I have created a slider that shows the current value above the slide bar, but what I need now is a way to populate a legend below the slide bar distanced the same as the slider (i.e. if the slider is 100px wide and there are five values the slider will snap every 20px. In this example, I would like the values in the legend to be placed at 20px intervals). Here is an example of what I want: Here is the jQuery I have (assimilated from the ui slider demo page): /

jQuery UI Slider - max value (not end of slider)

痴心易碎 提交于 2019-11-26 22:02:15
问题 I have a stepped slider, with non-linear steps - code: $(function() { var trueValues = [5, 10, 20, 50, 100, 150]; var values = [10, 20, 30, 40, 60, 100]; var slider = $("#parkSlider").slider({ orientation: 'horizontal', range: "min", value: 40, slide: function(event, ui) { var includeLeft = event.keyCode != $.ui.keyCode.RIGHT; var includeRight = event.keyCode != $.ui.keyCode.LEFT; var value = findNearest(includeLeft, includeRight, ui.value); slider.slider('value', value); $("#amount").val