Help with jQuery UI slide ranger

Asked

Viewed 80 times

0

I have a slider ranger jQuery ui it works normal but the problem is that when I’m on mobile(by mobile) I can’t drag the slide so it works have to click on top.

$(function() {
    $("#hora-range").slider({
        range: true,
        min: 0,
        max: 1440,
        step: 15,
        slide: function(e, ui) {
            $(".min-hora-label").html('HORA MIN= ' + ui.values[0]);
            $(".max-hora-label").html('HORA MAX= ' + ui.values[1]);
        }
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>

<div id="hora-range"></div>
<div class="min-hora-label"></div>
<div class="max-hora-label"></div>

The code is also on Jsfiddle.

I Googled and found the jQuery Touch Punch that promised to solve the problem but I couldn’t. Does anyone know what might be happening?

  • Tried with "touch-action: pan-x" ?

  • @hugocsl where I put him?

  • I don’t know if it solves, I suggested you take a test. Put on .css guy #slider { touch-action: pan-x; } here you can read more https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action

  • Punch works perfectly, maybe you implemented it wrong. Take a look at this link, test and see the source code to see what the structure looks like.

  • Related: https://answall.com/q/266755/8063

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.