472,989 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 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 4995
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
1
by: Jean-Gael GRICOURT | last post by:
I am trying to capture mouse events when entering and leaving a DIV layer. This test code works fine with IE 6.0 and Opera 7.21 but fails with Mozilla/Netscape. The strange thing is that the mouse...
2
by: George Hester | last post by:
This question is specific to Microsoft Internet Explorer 5 +. I have an input box that gets the focus when the page loads. Using a suggestion earlier here I have re-written the code better. At...
4
by: masantha wee | last post by:
Hi all, I am using Firefox and embedding Javascript in html. I understand that we can use mouse events by coding them in the body of html (by creating a button or anything and by adding in the...
5
by: gsb | last post by:
I track the mouse location like this code: function mousePos(e) { var p = new Object(); if(e) { p.x = e.pageX; p.y = e.pageY; } else { p.x = event.x; p.y = event.y; } ... (show) }...
3
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events....
6
by: marss | last post by:
Hi, How can I define in Firefox whether the left mouse button is pressed when I move mouse over a html element? The documentation says that "e.button == 0 for standard 'click', usually left...
3
by: Beshoo | last post by:
Do u have any idea how can i detect if the mouse on acertain object for exapmle I have <divi wnat if the mouse on this <divtake an action ????
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.