473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 5018
> 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.