Skip to content

Instantly share code, notes, and snippets.

@codecaffeine
codecaffeine / UIWebView tracking movements
Created January 21, 2011 15:40
Idea. I'm not sure if this'll even work
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return [curleft,curtop];
}