views:

111

answers:

2

i am using jquery slider . Is there any default function to display slider value under slider object

+2  A: 

Get or set the value option, after init. From option-value

var value = $('.selector').slider('option', 'value');

Determines the value of the slider, if there's only one handle. If there is more than one handle, determines the value of the first handle.

Edit:

Use the slide event for displaying the value when the slider is changed

slide

This event is triggered on every mouse move during slide. Use ui.value (single-handled sliders) to obtain the value of the current handle, $(..).slider('value', index) to get another handles' value.

Code examples

Supply a callback function to handle the slide event as an init option.

$('.selector').slider({
   slide: function(event, ui) { ... }
});

Bind to the slide event by type: slide.

$('.selector').bind('slide', function(event, ui) {
  ...
});
rahul
May I know the reason for down vote?
rahul
i need a solution to display the value not to set the value
Paniyar
This one gets the value in the variable 'value'.
rahul
ya you are right but i'm asking any default function along with slider. To set manually we have to take care of the alignment using css
Paniyar
A: 

No, there is no 'default function' to display slider value under slider object.

madcolor
But can use the slide function to perform this one.
rahul
Absolutely, but OP wants some builtin functionality that doesn't exist..
madcolor