Getting the values of jQuery UI Slider
/*
Getting the values of jQuery UI Slider.
Link: http://jqueryui.com/slider/
Using this component I needed to get the range, I will explain how I did.
Obteniendo los valores de jQuery UI Slider
Usando este componente tuve la necesidad de obtener los rangos, explico a continuación como lo hice.
*/
$( "#progressbar" ).slider({
range: !0,
min: 2e3,
max: 2013,
step: 1,
values: [2e3, 2013],
slide: function(a, b){
var min = b.values[0];
var max = b.values[1];
console.log(min + " " + max);
return $(".nav .active").removeClass("active"), $(".y" + b.values[0]).addClass("active"), $(".y" + b.values[1]).addClass("active"), $("span.nav").html(b.values[0] + "-" + b.values[1])
},
start: function( a, b) {
//console.log(event);
},
stop: function(a, b){
//console.log(event);
}
});
Written by Yesi D
Related protips
1 Response
Y si se quiere obtener los valores fuera del slider sería de esta manera:
var start = $( "#progressbar" ).slider('option','values')[0];
var end = $( "#progressbar" ).slider('option','values')[1];
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Related Tags
#jquery
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#