Kashif Hashmi
Kashif Hashmi

Reputation: 75

How can i use draggable on device

I have used draggable feature of jquery.

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<script>
$('.div').draggable(); 
</script>
<body>
<div class="div">
Text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
</div>
</body>

Above quote is working on desktop but not working on mobile or ipad.

Upvotes: 2

Views: 849

Answers (1)

filoxo
filoxo

Reputation: 8370

The jQuery UI user interface library currently does not support the use of touch events. That means that the UI you designed and tested in your desktop browser will fail on most, if not all, touch-enabled mobile devices, because jQuery UI listens to mouse events (like mouseover, mousemove and mouseout ) and not touch events (touchstart, touchmove and touchend).

You could try jQuery UI Touch Punch. It may do what you're asking but be warned:

Touch Punch is a hack. It duck punches some of jQuery UI's core functionality to handle the mapping of touch events. Touch Punch works with all basic implementations of jQuery UI's interactions and widgets. However, you may find more complex cases where Touch Punch fails.

Upvotes: 2

Related Questions