iPad Safari's mapping of mouse events to touch events in image-maps

后端 未结 2 819
庸人自扰
庸人自扰 2021-02-08 10:03

My website makes extensive use of image-maps. The images are of pages from a medieval manuscript. The mouseOver event of the AREA tags has a tooltip attached to it, which displa

2条回答
  •  死守一世寂寞
    2021-02-08 10:20

    I have been doing some research on specifically when the iPad fires "mouseover" events versus "click" events. When the user taps anywhere on the page the iPad first fires a "mouseover" event as though the user had just placed a mouse cursor on that spot. It also fires a "mouseout" event on the last element that had focus. The browser then, as far as I can tell, checks whether any changes to the DOM occurred as a result of "mouseover" event callback.

    If there has been a change to the DOM the browser does not fire a "click" event. If the user taps on the same element a second time the browser does fire a "click" event but does not fire another "mouseover" event.

    On the other hand, if after the user taps on an element for the first time and the DOM has not changed after the "mouseover" event completes, then the browser fires a "click" event without waiting for a second tap.

提交回复
热议问题