Html
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect libraries jQuery and jQuery UI -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<script src="https://dir.by/example_lib/jquery_ui/jquery-ui-1.12.1/jquery-ui.min.js"></script>
<!-- HTML Elements -->
<div id="myElement" style="height:150px; width:150px; cursor:hand; background:#b0b0b0;">
Click on me and drag me with your mouse
</div>
<!-- JavaScript -->
<script>
// the page has opened
$( function()
{
// call the method draggable so that he can drag and drop myElement
$("#myElement").draggable();
});
</script>
</body>
</html>
Explanation
One line is added to the code, this is the connection of the library
jQuery UI Touch Punch ... to drag and drop on tablet, phone.
Html
<script src="https://dir.by/example_lib/touch-punch/jquery.ui.touch-punch.js"></script>
All example code to drag and drop on tablet, phone
In the code, the added line is highlighted
Blue.
Html
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect libraries jQuery and jQuery UI -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<script src="https://dir.by/example_lib/jquery_ui/jquery-ui-1.12.1/jquery-ui.min.js"></script>
<!-- drag-and-drop library for tablet, phone -->
<script src="https://dir.by/example_lib/touch-punch/jquery.ui.touch-punch.js"></script>
<!-- HTML Elements -->
<div id="myElement" style="height:150px; width:150px; cursor:hand; background:#b0b0b0;">
Click on me and drag me with your mouse
</div>
<!-- JavaScript -->
<script>
// the page has opened
$( function()
{
// call the method draggable so that he can drag and drop myElement
$("#myElement").draggable();
});
</script>
</body>
</html>
1) пример для браузера используя мышь: example1
2) пример для планшетов: example2
Вы проверили последний пример? answer