Solved

track mouse location over an iframe

Posted on 2004-04-10
2
765 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…

776 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