+ 2
Touchmove event on parentNode
The first and the second divs are identical except the second div has children elements. How can I make the second div still dragable despite the children nodes? https://code.sololearn.com/WBsydOko1ozF/?ref=app
6 Respostas
+ 3
Or changing how touchmove event is handled in Section.. Replace with:
Second.addEventListener('touchmove', function(ev){
touch=ev.targetTouches[0];
ev.currentTarget.style.left=touch.pageX-50+"px";
ev.currentTarget.style.top=touch.pageY-50+"px";
ev.stopPropagation()
}, true)
If you dont know why it work in this way, i can point you to some explaination
+ 3
Hey, i used a psuedo element to, make it draggable. the problem was the children were preventing you to be able to actually touch the second element.
https://code.sololearn.com/WVh0LPzUD0G7/?ref=app
+ 3
<resolved> looks like
Good answer xp nvdo
+ 1
thanks. 👍
+ 1
Fernando Moceces Its not currentTarget only that solve the problem 😉.
Anyway, you are welcome 👍👍👍