Touch API (e.g. touchstart) not working in MS Edge

前端 未结 3 1073
甜味超标
甜味超标 2020-12-28 18:00

my application is using the Touch API to detect touch events in JavaScript. Example:

$(\".element\").on(\"touchstart\", function(event){
    alert(\"TRUE\");         


        
3条回答
  •  臣服心动
    2020-12-28 18:20

    Did you enable custom touch handling ? You can do it with the following css snippet (on the body tag or just a container for geastures) :

    -ms-touch-action: none;
    

    Next, touch API is a webkit feature (maybe there is an error in CanIuse ?). IE and Edge have a similar feature known as Pointer API. But you can use a polyfill library like this : https://github.com/CamHenlin/TouchPolyfill

提交回复
热议问题