I am trying to drag a div using Hammer.js
var revcircle = document.getElementById('rev-circle');
var rc = new Hammer(revcircle);
rc.on("drag", function(event) {
event.preventDefault();
alert('dragged');
});
rev-circle is my div id.
<div class="mini-circles1" id="rev-circle" draggable="true">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. <br/><br/> John Campbell<br>President and CEO<br> Toranto Waterfront Revitalization Corportation</p>
</div>
I have included jquery ui also. But the it is not recognizing drag functionality. tap swipe etc are working fine. I am using hammer version v2.0.4.
Am I missing anything here???
In Hammer.js v2.0.x, it seems its "pan" instead of "drag".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With