Solved

track mouse location over an iframe

Posted on 2004-04-10
2
767 Views
Last Modified: 2012-05-04
Hello!

What I am trying to do is display a custom context menu when the user right clicks on an object within an iframe.  I want to display the menu on the parent and not within the iframe because it needs to show up on top of the iframe in case it is popped up next to the edge and gets lost underneath.

The problem is, i'm having trouble tracking the mouse coordinates from the parent when the mouse is over the iframe. event.clientY and event.clientX just give an error, and i tried storing the coordinates onmousemove but it always looses them when it rolls over the iframe, and the menu just pops up at the edge where the mouse was last tracked.

Is there any way to track the coordinates from the parent even when it's over the iframe?

thanks for any help!
-Scott
0
Comment
Question by:scottarius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
devic earned 300 total points
ID: 10799428
hi scottarius,

i uploded an example:
====================
http://home.arcor.de/athens/expexc/js/position/track_mouse_over_iframe/mainpage.html
0
 

Author Comment

by:scottarius
ID: 10799449
excellent!

that's two in one day you've helped me solve :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question