I have an iframe
<iframe id="EXAMPLE"></iframe>
edited:
How can I make the iframe to get the mouse cordinaes on real time with javascript?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In HTML you have this:
Set some CSS styles:
Now, you have to get the mouse position on document. You can use jQuery
mousemovehandler:Then, set the
iframeposition on document:Now, just simply call
updatefunction inside ofmousemove.See live preview here.
If you want to detect
mousemoveoniframe, too, addpointer-events:nonetoiframestyles. Tested here.