Solved

track mouse location over an iframe

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Getting AngularJS to work on jsfiddle 7 37
Problem to picture file 3 40
Adding Extra Information box 4 25
Asp.net mvc 5 5 17
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now