jQuery UI slider Touch & Drag/Drop support on Mobile devices

后端 未结 2 755
抹茶落季
抹茶落季 2020-12-07 10:45

I have already styled and implemented jQuery UI slider into a project. Though it\'s responsive, the slider does not respond to being touched and dragged. Instead, you have t

相关标签:
2条回答
  • 2020-12-07 11:11

    jQuery ui doesn't have touch support. You should use it with jQuery-ui touch punch.

    Just add the script after jQuery ui:

    <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
    <script src="jquery.ui.touch-punch.min.js"></script>
    

    You can also use cdnjs:

    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
    

    Note: Better give this repo a star on Github.

    0 讨论(0)
  • 2020-12-07 11:19

    You can just link this js.

    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
    

    thanks.

    0 讨论(0)
提交回复
热议问题