Reputation: 35
I used jQuery-ui plugin and jquery.ui.touch-punch to realize drag slider event on mobile device. I closed click event, and I want only when I drag the handle, it works. Everhthing works fine, except when I touch the handle first(don't touchmove, just touchstart) it moves each time, and I don't know why, hope someone can elaborate it for me. Thanks for advance^ ^
$('#head_slider').slider({
orientation: "vertical",
range: "min",
max: 10,
value: 5,
step: 1,
change: function( event, ui ) {
var value = $('#head_slider').slider( "option", "value" );
$('#adj_head').animate({
top: (-70 - value*10)+'px'
});
},
slide: function( event, ui ) {
var value = $('#head_slider').slider( "option", "value" );
}
})
Upvotes: 2
Views: 312