K20GH
K20GH

Reputation: 6263

Bootstrap Slider Controls?

I'm currently using http://www.eyecon.ro/bootstrap-slider/ which works a treat, however i'd like to output the value in realtime to an input box.

The js does this to a tooltip which is fine, however once you leave the slider, you can't see what you set it to. Any suggestions?

Upvotes: 11

Views: 38538

Answers (1)

techfoobar
techfoobar

Reputation: 66663

You can log the slider value at real time using the slide event that is supplied with the plugin.

See this demo: http://jsfiddle.net/vMLPF/1/

Code:

$('#foo').slider().on('slide', function(_ev) {
    $('#bar').val(_ev.value);
});

In the above code, #bar represents the input box in which you want to show the slider value in real time.

Upvotes: 21

Related Questions