0
i want to resize left panel element when the resize element is drag to the left or right...
-my code works on my PC but won't work on chrome browser or on my phone... -Can anyone suggest another way of resizing the left panel when the the resize element is drag.. -my source code:https://code.sololearn.com/W1LQ3h33lvvy/?ref=app
3 ответов
+ 2
Add this event to your code:
resize_el.addEventListener("touchmove", function(e){
let touch = e.targetTouches[0];
resize_el.style.left =
touch.pageX-50+"px";
})
+ 2
Pointer events are agnostic to device. Use it instead only mouse or touch type.
https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events
+ 1
The eventListener are only for mouse. Look up the ones for touch devices