Last active
December 12, 2015 00:48
-
-
Save ixisio/4685856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function touchMoveOut(evt) { | |
var | |
touchObj = {} | |
, tolerance = 15 | |
, containment | |
, px | |
, py | |
touchObj.coords = evt.touches[0] || evt.changedTouches[0] | |
px = touchObj.coords.pageX | |
py = touchObj.coords.pageY | |
// @prob -> Life would be much easier with native supported | |
// tap events. | |
// evt.touches[0] refers to orginated DOM Element | |
// NOT to the actual element under the finger, sucks! | |
// @solution -> (A) document.elementFromPoint(px, py) ? | |
// (B) store all possible candidates (DOM-Elements) | |
// and compare their position (w,h + offset x,y) | |
// with the current touch point. | |
// (C) @todo -> try to find another one! | |
} | |
document.addEventListener("touchmove", touchMoveOut, false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment