473,508 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event capturing/bubbling problem

Hi,

I ran out of ideas how to solve this problem, maybe someone of you
will help me.. Situation goes like this: I have two elements on site
which are siblings, both of them have "onclick" event. On of these
elements has "position: absolute" and is covering the second element.
What I want to achieve, is when user clicks on the absolute positioned
element, "onclick" event fires for both elements. I tried just
everything that camed to my mind, but wihtout result. Anyone got an
idea how to achieve this? Or is it just impossible to make?

Thanks for any help,
Piotr.

Jul 23 '07 #1
3 1414
On Jul 22, 8:45 pm, Piotr K <piotr.korzeniew...@gmail.comwrote:
Hi,

I ran out of ideas how to solve this problem, maybe someone of you
will help me.. Situation goes like this: I have two elements on site
which are siblings, both of them have "onclick" event. On of these
elements has "position: absolute" and is covering the second element.
What I want to achieve, is when user clicks on the absolute positioned
element, "onclick" event fires for both elements. I tried just
Why don't you just call the onclick handler for the overlapped element
from the positioned element's onclick handler?
everything that camed to my mind, but wihtout result. Anyone
got an
idea how to achieve this? Or is it just impossible to make?
I don't understand what you are trying to make.

Jul 23 '07 #2
On Jul 23, 10:45 am, Piotr K <piotr.korzeniew...@gmail.comwrote:
Hi,

I ran out of ideas how to solve this problem, maybe someone of you
will help me.. Situation goes like this: I have two elements on site
which are siblings, both of them have "onclick" event. On of these
elements has "position: absolute" and is covering the second element.
What I want to achieve, is when user clicks on the absolute positioned
element, "onclick" event fires for both elements. I tried just
everything that camed to my mind, but wihtout result. Anyone got an
idea how to achieve this? Or is it just impossible to make?
Not impossible, as David has suggested. Events bubble up or capture
down the DOM tree, the siblings of the element that starts the event
(or that are higher up the DOM tree) will never be involved in either
sequence. At least one major browser doesn't support the capture
phase anyway.
--
Rob

Jul 23 '07 #3
On 23 Lip, 03:57, David Mark <dmark.cins...@gmail.comwrote:
On Jul 22, 8:45 pm, Piotr K <piotr.korzeniew...@gmail.comwrote:
Hi,
I ran out of ideas how to solve this problem, maybe someone of you
will help me.. Situation goes like this: I have two elements on site
which are siblings, both of them have "onclick" event. On of these
elements has "position: absolute" and is covering the second element.
What I want to achieve, is when user clicks on the absolute positioned
element, "onclick" event fires for both elements. I tried just

Why don't you just call the onclick handler for the overlapped element
from the positioned element's onclick handler?
everything that camed to my mind, but wihtout result. Anyone
got an
idea how to achieve this? Or is it just impossible to make?

I don't understand what you are trying to make.
Well, it was just an example, that absolute positioned element won't
always entirely cover the second element. What I'm making is
drag'n'drop feature with containers where you can drop dragged
elements. Currently I'm checking if element is dragged above container
at global onmousemove event (by checking if mouse position is in
container boundaries), but it isn't too efficient. It would be much
faster and more accurate if mouse events would fire also for elements
under the dragged element.

Jul 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9747
by: Paolo Mancini | last post by:
Hi all, I have a page with many different elements: <a href="...."> ... </a>, listboxes, radiobuttons, etc. Can I use javascript to prevent the user from interacting with the page? That is:...
1
1387
by: john | last post by:
I1. notice that if you have an onclick event for both the document and for a particular element, the onclick for the element is called first and then it bubbles up to the one for the document. Is...
3
1455
by: Robert Mark Bram | last post by:
Hi All! In the code below, I want to add a handler to a *row* (eventually so I can change the style of a row), but the event is being generated by the TD's it seems - in Opera and IE. Is there...
5
1995
by: Mark Szlazak | last post by:
Apparently there is a textarea onscroll event bubbling bug in Firefox and Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=229089 I'm trying to check for this bug with the following...
4
1939
by: Wee Bubba | last post by:
the following event handler checks to see if any parent control has attached to the event 'SearchItemSelect'. i use it for event bubbling whenever one of my search items has been selected and at...
3
2546
by: Lars Netzel | last post by:
I have made a pretty small and simple webCustomerControl that basically just renders some HTML tables... I want parts of this to be clickable to fire off a "Click Event" that you can use as a...
1
1420
by: Jonah Olsson | last post by:
Hello, I'm trying to build an "add-on" to an already existing custom web user control. The old control collects some user data and saves it to a database. The new control should collect some...
7
3326
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
17
10156
by: dan_williams | last post by:
I have the following test web page:- <html> <head><title>Test</title> <script language="Javascript"> <!-- function fnTR() { alert("TR"); }
0
7229
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
7333
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
7398
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...
1
7061
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
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
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...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.