javascript - Get absolute mouse position from inside iframe -
I have a webpage with an iframe which provides another page (same domain). I need to get the position of the mouse in relation to the original document. Keep in mind that iframe can scroll both methods. I have tried using offset with no luck.
$ ('# iframe'). material (). ('Html'). ('Mousemove', function (e) {// gives me space in the context of iphim, but not whole page. Var y = e.pageY; // gives me var var = y ($). ) Top; // more code here ....})
do this One way is to get the position of iframe in parent window and add it to the position of the mouse rather than iframe. Your code is being expanded down,
var iframepos = $ ("# iframe"). Event (); $ '(Iframe' top; console.log (x + "+ y);})
Comments
Post a Comment