12th May 2011 at 10:28am

Clicking the document at a location

Can be done simply using JQuery:

$(document.elementFromPoint(x, y)).click();

Or natively in Webkit:

var el = document.elementFromPoint(x, y);
var ev = document.createEvent(“MouseEvents”);
ev.initEvent(“click”,true,true);
el.dispatchEvent(ev);

 

Why do I need to do this? Ah… iPhone development…

 

Add Comment: Sign-in-with-twitter-darker

All comments

none!