First of all, I'm new with javascript so sorry if that sounds stupid haha
I'm trying to write some code to create a drag and drop minigame. So far I'm having a problem with the touchable part of the code. When I added the draggable option (with cursor only) it worked perfectly. But I tried to add some touchable code (to allow people on phones or tablets to use it as well) using this tuto : https://www.kirupa.com/html5/drag.htm .
I have two problems though :
How do I trigger droppable touch events ? It works with mouse with the code below, but I can't figure how to do the same and for exemple trigger an alert when we drop with touchend ?
$('#lundi').droppable({
drop: handleDropEvent
})
function handleDropEvent(event, ui) {
var draggable = ui.draggable;
alert('On a drop "' + draggable.attr('id') + '" sur moi !');
}
I've tried Touch Punch but it didn't change anything, so I don't know if I did something wrong of if this just doesn't work ?
You can see the problem here : http://jsfiddle.net/uy0m5L8c/
Thanks a lot for your kind help !