Questions tagged [event-bubbling]

The concept of parent elements handling events that are propagated by a child element

In event bubbling, an event is propagated through the ancestors of the element that initially receives the event.

For example:

<div id='main' onclick='mainCode();'>
<div id='kid1' onclick='myVar=1;'></div>
<div id='kid2' onclick='myVar=2;'></div>
</div>

The click event bubbles, and so is propagated to the main <div> element after being handled by a kid <div> element.

This can make code simpler to understand, for example if mainCode() has access to the myVar variable, determining which kid sent the message is easy.

References

567 questions
0
votes
1 answer

handle jquery event bubbling on table cell hover

I have just started on event bubbling in jQuery so my understanding is very limited. I have a requirement to handle all the events that happen on the html table (grid) row/cells on parent container level. Example: 1. when the user click on a row, I…
Sri Reddy
  • 6,832
  • 20
  • 70
  • 112
0
votes
1 answer

Event bubbling JQuery FullCalendar + Backbone

I'm currently making an application with Backbone.js and some JQuery libraries. Today I work on a Calendar using JQuery FullCalendar and I have a little problem : If I click on day then close the form then click on an other day then I close etc...…
Awea
  • 3,163
  • 8
  • 40
  • 59
0
votes
1 answer

How can I get event bubbling to work when a div is clicked the first time?

I'm making a calendar. I want the user to be able to click anywhere inside a particular day (table cell) and something happens. There may be events for that day, which are contained inside a div within the table cell. If the user clicks on the div,…
John Anderson
  • 1,075
  • 5
  • 21
  • 25
0
votes
3 answers

need help understanding event bubbling code in WPF

the following code was supposed to turn all the buttons present in the form into green color on one of the button clicks due to event bubbling, but on my machine on Visual studio 2008, it is turning only the clicked button as green, could you please…
mohits00691
  • 137
  • 1
  • 11
0
votes
3 answers

JS Events that don't bubble (progress, loadedmetadata, etc)

I found out that certain events on the video/audio tag don't bubble (loadedmetadata, progress, etc). Is this against the standard or is it common for other events? How am I supposed to know what events are supposed to bubble or not bubble?
jdw
  • 1,533
  • 3
  • 17
  • 26
-1
votes
2 answers

Javascript - Remove event listener at resize

I'm doing some work to make navigation fully accessible by mouse over, keyboard and click, depending on the resolution. I am looking for that in mobile, only the click works. And hover, click, keyboard for higher resolutions. Important edit : It…
-1
votes
1 answer

Stop event from bubbling to the children

I thought I grasped the concept of bubbling, but now it seems I have not. I created this semi-modal dialog:
The .context-menu is position: fixed and takes the whole…
rcheetah
  • 37
  • 4
-1
votes
2 answers

How to make click only on modal exterior and not on dialog/content?

So I'm making an extension for Google Chrome with my friend, and for most of the features (i.e. calendar, settings, etc.) we open a modal so we don't have to redirect to another page. We are trying to get the modal to close when you click outside of…
-1
votes
1 answer

Json.NET DeserializeObject allow constructor exception to bubble up

I am using the JsonConvert.DeserializeObject(string value) method to deserialize an object of type T from a string. In a custom class (which I am attempting to deserialize) I perform checks on the arguments supplied to the constructor and can…
Callum Watkins
  • 2,844
  • 4
  • 29
  • 49
-1
votes
3 answers

How to disable title tooltips! (was: How to get element behind event target in Javascript?)

I have an element positioned on top of another element, how do I ignore the click capture of the top element and pass it to the one below it? $('a[title]').each(function (index) { $(this).after('<div class="overlay"…
Dathan
  • 1,125
  • 1
  • 9
  • 11
-2
votes
1 answer

WPF Event Not Bubbling to the WIndow

Here's the C# code: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { txt1.Text = "Button is…
Ron
  • 2,435
  • 3
  • 25
  • 34
-2
votes
3 answers

A way to remove click events for element

I have an element #foo and it has click event on it. Element #foo is in element #bar which also has click event on it.
When #foo is clicked, #bar event gets called and #foo event gets ignored. That's now…
daGrevis
  • 21,014
  • 37
  • 100
  • 139
1 2 3
37
38