Preferred Alternative to OnMouseOver for touch

前端 未结 5 1772
终归单人心
终归单人心 2020-11-28 10:16

Is there a preferred alternative or best practice for handling OnMouseOver javascript events on touch devices? All I can think is to convert all events to OnMouseClick. Un

5条回答
  •  被撕碎了的回忆
    2020-11-28 11:07

    Depending on your demands and targeted users, you may be interested in the touch JS APIs available (at least) on mobile Safari and Chrome. Check http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html, for a quick (perhaps a bit dated) intro. I haven't really used these extensively (only targeting iPhone, for instance) but I've been very happy with the results I've gotten so far.

提交回复
热议问题