touchend event in ios webkit not firing?

后端 未结 4 970
滥情空心
滥情空心 2021-02-04 16:08

I\'m trying to implement a menu for a ios webkit based app in which the user touches/clicks and holds a menu button (\'.menu_item\'), after 500ms the sub menu opens (div.slide_u

4条回答
  •  [愿得一人]
    2021-02-04 16:44

    touchend does not fire because touchcancel has fired earlier. If you want full touch evens handling you need to call

    e.preventDefault()
    

    in the callback of "touchmove" event, otherwise when a touchmove event occurs if the browser decides that this is a scroll event it will fire touchcancel and never fire touchend.

提交回复
热议问题