Maybe something like this will work?
var elementIdTouching = ""; $('body').on("touchmove", function(e){ var tList = e.touches; // get list of all touches for (var i = 0; i < tList.length; i++) { var thisTouch = tList[i]; // not 100% sure about this var elementTouching = document.elementFromPoint( thisTouch.screenX, thisTouch.screenY ); if (elementTouching.id != elementIdTouching) { elementIdTouching = elementTouching.id; if (elementTouching.id == "myImg") { alert("entered!"); } } } }).on("touchend", function(e){ elementIdTouching = ""; }); $('#myImg').on("mouseenter", function(e){ alert('entered!'); });
tList ~ https://developer.mozilla.org/en-US/docs/Web/API/TouchList
Disclaimer: I have not tested this.
source share