473,394 Members | 1,671 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,394 software developers and data experts.

Cascading onclick event

Hi,

I'm not sure what the correct term for this is, but I want to have two
objects (say HTML divs) positioned absolutely one on top of the other,
with the lower of the two having an onclick event attached to it.

Now as you can guess, if I then click on where the top and bottom object
overlap, the top object intercepts the click and the onclick event for
the bottom object is never fired.

What I want to do is to have the even "cascade" with the top object
ignoring the click and letting the bottom one handle it. Is this
possible? Am I being too vague?

Cheers,

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Feb 17 '06 #1
4 3623

Dylan Parry wrote:
Hi,

I'm not sure what the correct term for this is, but I want to have two
objects (say HTML divs) positioned absolutely one on top of the other,
with the lower of the two having an onclick event attached to it.

Now as you can guess, if I then click on where the top and bottom object
overlap, the top object intercepts the click and the onclick event for
the bottom object is never fired.

What I want to do is to have the even "cascade" with the top object
ignoring the click and letting the bottom one handle it. Is this
possible? Am I being too vague?

Cheers,

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!


Try these:
http://www.quirksmode.org/js/events_order.html
http://www.webdevelopersjournal.com/...jsevents2.html

I'm not sure if you have your div inside the other div or just
positioned absolutely but if nested you can use eventbubbling.

Feb 17 '06 #2
Pondering the eternal question of "Hobnobs or Rich Tea?", impaler
finally proclaimed:
http://www.webdevelopersjournal.com/...jsevents2.html
eventCapture() seems to be what I am looking for, but it only works in
IE. Is there an alternative that does something like that in FF et al?
I'm not sure if you have your div inside the other div or just
positioned absolutely but if nested you can use eventbubbling.


Unfortunately they're not, so bubbling isn't an option. If I do nest the
divs a whole other can of worms is opened :s

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Feb 17 '06 #3
Pondering the eternal question of "Hobnobs or Rich Tea?", Dylan Parry
finally proclaimed:
http://www.webdevelopersjournal.com/...jsevents2.html


eventCapture() seems to be what I am looking for, but it only works in
IE. Is there an alternative that does something like that in FF et al?


erm setCapture() I meant! :)

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Feb 17 '06 #4
Dylan Parry wrote:
[...] impaler [wrote]:
http://www.webdevelopersjournal.com/...jsevents2.html


eventCapture() seems to be what I am looking for, but it only works in
IE. Is there an alternative that does something like that in FF et al?


The code there is not only IE-specific, it is junk. Do not
trust this source. Read the specs about event flow instead,
then apply the specified interfaces.

<URL:http://www.w3.org/TR/DOM-Level-2-Events/events.html>
HTH

PointedEars
Feb 17 '06 #5

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

Similar topics

0
by: Humpty Dumpty | last post by:
Hi folks, here's a challenge: I have a dynamically created cascading menu in Tkinter that can be quite large because it is created from a file. I tried using lazy creation so only the menu item...
7
by: Marci | last post by:
I found this script for cascading menus, however, I cannot reach the author to solve the bug I am having when I add a second menu to it. My problem is this: If I click on the first link, the...
2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
7
kcdoell
by: kcdoell | last post by:
I have three tables: One for the Division location: tblDivision DivisionID = Autonumber DivisionName = Text One for the Working Region: tblWrkRegion
1
kcdoell
by: kcdoell | last post by:
Good Morning: I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off: Procedure declaration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.