0

i got a jquery ui slider and i want to show the value of the slider in a tooltip, (in handler of the slider). so far im getting the value when the slider stops, but i want the tooltip to update the value when the slider is dragged. is there a way to get jquery UI slider current position, not the value?

Mijail Dan Cohen
  • 189
  • 1
  • 1
  • 13

2 Answers2

2

Use the slide function

$( "#slider" ).slider({
    slide: function(event,ui){
        $('#value').text(ui.value);    
    }
});

Example

http://jsfiddle.net/jcMu8/

Trevor
  • 16,080
  • 9
  • 52
  • 83
  • 1
    works like a charm... i haved trouble to target the element that takes the tooltip value but once i did it "salio arando" like we say here. `slide: function(event,ui){ $('.ui-slider-handle').attr("data-original-title",ui.value); }` thx a lot! – Mijail Dan Cohen Apr 21 '14 at 18:59
0

write a jquery function that is triggered by the slider slide event that replaces the value of the tool tip.

slide: function(event, ui){ //replace value
}

Charlie Liu
  • 105
  • 1
  • 9