How can i access the value of the moving slider in a jquery variable
Posted
by
user1673591
on Stack Overflow
See other posts from Stack Overflow
or by user1673591
Published on 2014-08-19T16:17:20Z
Indexed on
2014/08/19
16:20 UTC
Read the original article
Hit count: 163
html
<h1>HTML Slider Test</h1>
<div class="slider" data-max="10"></div>
<p>Your slider has a value of <span class="slider-value"></span></p>
<div class="slider" data-max="100"></div>
<p>Your slider has a value of <span class="slider-value"></span></p>
jquery
$(".slider").each(function() {
$(this).slider({
value : 1,
min : 1,
max : $(this).data('max'),
step : 1,
slide : function (event, ui) {
var a= $(this).next().find('span.slider-value').html(ui.value);
}
});
});
I want the value of the moving slider in a jquery variable
© Stack Overflow or respective owner