473,498 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Click event handling

3 New Member
Helo,

I have 2 absolute positioned DIVs and the second one partly overlays the first. Each DIV has its own onclick handler. If I click the second DIV (the top one), only its handler is called. But I want the first underlying DIV handler to be also called.

The DIVs are not nested, they are brothers, like this:

[HTML]<div id="div1"></div>
<div id="div2"></div>[/HTML]

Is there any solution? Thanks
Dec 10 '07 #1
5 1212
gits
5,390 Recognized Expert Moderator Expert
hi ...

welcome to TSDN ...

why not call the corresponding click handler function explicitly?

kind regards
Dec 10 '07 #2
ragulin
3 New Member
hi,
this is only an example. this problem occured in more complex script, so i created this example to illustrate it. Its not possible to call click handler explicitly.
Dec 11 '07 #3
gits
5,390 Recognized Expert Moderator Expert
how do you apply the handler to the divs? ...
Dec 11 '07 #4
ragulin
3 New Member
through this function (method)

Expand|Select|Wrap|Line Numbers
  1. this.AttachEvent = function(target, eventType, handler)
  2.    {
  3.       if (target.attachEvent){
  4.          target.attachEvent("on"+eventType, handler);
  5.       }
  6.       else
  7.       {
  8.          if(target.addEventListener){
  9.             target.addEventListener(eventType, handler, false);
  10.          }
  11.       }
  12.    };
Dec 11 '07 #5
gits
5,390 Recognized Expert Moderator Expert
ok ... so handler is the code for the click later on ... and now i ask again: why not call the handler explicitly? ... i assume you know when to call it? or is the page dynamically handled ... drag/drop or something else that makes the divs overlapping in some cases?
Dec 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
29051
by: Tamir Khason | last post by:
I build user control, consists of different things (e.g label, image, etc.) I want to handle click (and other) events, however I can not do it until I do not assign event handler for each control...
4
3837
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
4
4007
by: Mark Lingen | last post by:
I've found a problem with postback event handling and webcontrol buttons. Try out the following code in an ASP.Net project and you will see. Create a web project in VB.Net and drop this code...
3
2789
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
1
2509
by: Mauritsius | last post by:
I have a simple page where I would like to modify a repeater (bounded to a dataset) if a button (outside the repeater) is clicked or not. I tried to solve this with a button click event that...
3
2665
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
5
5147
by: sethuganesh | last post by:
hi, i have created a sample window aplication in VB.NET.placed a listview component in the form ,written click and double click event for list view.But the events are not fired.is there any...
12
2183
by: cj | last post by:
I would like to have menu items a main menu bar that represent the days of the week. When you click on them they alternate from checked to unchecked. Right now I have 7 subs that look like this...
1
2082
by: dave | last post by:
I have a html table and mutliple rows. On each row i put an onclick event that opesn a modal window and prompts the user for some information. I want this modal window to show when the user...
1
2839
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for...
0
7002
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
7165
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,...
1
6887
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
7379
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...
0
4590
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
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
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 ...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.