2

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" );
        }
    })
silk
  • 35
  • 9
  • [can't reproduce](https://jsfiddle.net/adeneo/3rz2sehk/) – adeneo Jul 29 '17 at 01:54
  • @adeneo It has no question on pc, but on mobile device, it has this question. I used a dot background png as handle and set its height and width. Don't know whether it matters. – silk Jul 29 '17 at 04:45

0 Answers0