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

C

CRPietschmann

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.
 
M

marss

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.
......
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top