471,596 Members | 803 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

How do you Pass Mouse Events through DIV element to the DIV element beneath it?

I'm using the Microsoft Virtual Earth Version 1 Commercial Control.
I want to make it so you can click on a pinpoint that's plotted on the
map and all mouse events are passed to the map so that the user can
click anywhere on the map (including the pin points) and drag/zoom the
map around.

For those of you who haven't used Virtual Earth:
Basically, there are a bunch on absolutely positioned Div elements. I
basically want to pass all mouse events from one absolutely positioned
div element to the absolutely positioned div element directly beneath
it.

Does anyone know how to do this?

Thanks, in advance.

Apr 27 '06 #1
2 4933
> I basically want to pass all mouse events from one absolutely positioned
div element to the absolutely positioned div element directly beneath
it.


I'm not sure that there is a standard functionality to pass event from
one absolutely positioned element to another.
Maybe next trick helps you (but it works only in IE).
You can attach event handler to upper div and find lower div in
function that processing event.
For example,

html:
<div onclick="onclick="ProcessClick(this);" ....

javascript:
function ProcessClick(sender)
{
//hide upper div
sender.style.display="none";
//get div directly beneath clicked one.
var lowerDiv = document.elementFromPoint(event.clientX,
event.clientY);
//restore upper div
sender.style.display="block";

//here you have event and div directly beneath clicked one.
......
}

Apr 28 '06 #2
> I basically want to pass all mouse events from one absolutely positioned
div element to the absolutely positioned div element directly beneath
it.


I'm not sure that there is a standard functionality to pass event from
one absolutely positioned element to another.
Maybe next trick helps you (but it works only in IE).
You can attach event handler to upper div and find lower div in
function that processing event.
For example,

html:
<div onclick="onclick="ProcessClick(this);" ....

javascript:
function ProcessClick(sender)
{
//hide upper div
sender.style.display="none";
//get div directly beneath clicked one.
var lowerDiv = document.elementFromPoint(event.clientX,
event.clientY);
//restore upper div
sender.style.display="block";

//here you have event and div directly beneath clicked one.
......
}

Apr 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jean-Gael GRICOURT | last post: by
2 posts views Thread by George Hester | last post: by
4 posts views Thread by masantha wee | last post: by
3 posts views Thread by Rick Strahl [MVP] | last post: by
3 posts views Thread by Beshoo | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.