Does jQuery mouseup event work on touch devices?

后端 未结 2 1964
走了就别回头了
走了就别回头了 2021-01-01 18:29

I couldn\'t find any answer so I\'m asking here. Currently I don\'t own any touch devices so I can\'t test it.

The following code hides all subcontainers in a contai

2条回答
  •  一生所求
    2021-01-01 19:25

    To bring this thread up-to-date (i.e. 2019), note that jQuery deprecated 'bind' as of version 3.

    Today when I first-tested a 'thumb-slider' (i.e. input element, type='range') on Android, it failed, because my event-functions named only mousemove and and mouseup respectively.

    I simply changed them to:

    $('#sliderID').on('touchmove mousemove', function(event){ ... } and $('#sliderID').on('touchend mouseup', function(event){ ... } and now the webapp works on both PC(Windows-10) and Android(v7.1) My jQuery version is 3.3.1.

    (These are the only two platforms I have available to me for testing, but I'm confident that this works in all major browsers. I've been successful on Chrome, Opera, Firefox, and Edge-on-Win10)

提交回复
热议问题