0

For an academic project, I am trying to implement a drag drop functionality on a list of some items, which i have achieved using dragula.js

I prepared a demo for same on jsfiddle, which can be found on below link

https://jsfiddle.net/4gadu5zc/

    <div class="button">
Add Element
</div>
<div class="list_wrap" id="list_1">
    <div class="list-item">
    Item 1
    </div>
    <div class="list-item">
    Item 2
    </div>
    <div class="list-item">
    Item 3
    </div>
    <div class="list-item">
    Item 4
    </div>
</div>
<div class="list_wrap">
    <div class="list-item">
    Item 5
    </div>
    <div class="list-item">
    Item 6
    </div>
    <div class="list-item">
    Item 7
    </div>
    <div class="list-item">
    Item 8
    </div>
</div>

But now i want add a swipe functionality on same item so that i can show some option with each item. To make you better understand this i prepared the below image.. enter image description here

I searched on internet I found the swipe functionality in ionic framework but not drag drop. I find hammer.js that supports all touch event but i do not know how to implement drag-srop and swipe using hammer on same element and also i do not know if the same thing will work on a dynamic element. Please help...

sumit
  • 1
  • 2
  • i've used swipe js and get easy implementation of it https://github.com/thebird/swipe?utm_source=jquer.in&utm_medium=website&utm_campaign=content-curation – Álvaro Touzón Nov 29 '16 at 13:49
  • Thanks for your reply.Swipe functionality can be done with any swipe enabled library. but i need to apply both swipe and drag functionality on same item. I do not know how to differentiate between a swipe and drag. because if i use dragula.js for drag drop it will bind drag event as soon as i click with mouse and swipe. I hope you'll understand my concern – sumit Nov 29 '16 at 13:56

0 Answers0