Solved

track mouse location over an iframe

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

635 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