Home > Enterprise >  is onTouchStart exactly equivalent to onMouseDown and onTouchEnd exactly equivalent to onMouseUp?
is onTouchStart exactly equivalent to onMouseDown and onTouchEnd exactly equivalent to onMouseUp?

Time:03-13

It is not behaving the same for me on a range slider.

The code that is triggered for the onm ouseDown and the onTouchStart is exactly the same code and same for the end and up.

So are they exactly equivalent or are there differences?

CodePudding user response:

The event order triggered is (most of the cases)

touchstart  > touchmove >  touched > mousemove > mousedown > mouseup > click

So No they are not the same or equivalent, but can be considered to perform similar functionality on different devices

CodePudding user response:

onTouchStart is used on touch screen surface whereas, onMouseDown is used when a user presses a mouse button over an element

  • Related