event-delegation Questions

7

Solved

What is the native implementation for event delegation on dynamically created dom elements? I tried looking at the jQuery source but I can't follow the .on method. Note: Currently I attach the ev...
Asset asked 11/8, 2014 at 16:44

1

I have an app that needs to be fully navigable by keyboard. When I click on the header of a div (generated by a javascript/jquery function), an event listener is triggered. I was able to highlight ...
Depreciatory asked 13/12, 2020 at 16:57

10

Can anyone please explain event delegation in JavaScript and how is it useful?
Kimsey asked 6/11, 2009 at 12:33

7

Solved

I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item, I would like to call a function which then emits an event which should in turn be handl...

2

Solved

I'm trying to do event delegation in vanilla JS. I have a button inside a container like this <div id="quiz"> <button id="game-again" class="game-again"> <span class="icon-spinner...
Overview asked 9/6, 2014 at 9:31

2

Solved

How do I implement event delegation for the mouseenter event? I'm looking for the equivalent to this jQuery code, but didn't manage to understand how jQuery does it internally: $(document).on('mo...
Afterdamp asked 4/5, 2018 at 14:30

1

Solved

I'm trying to stop a particular click event from bubbling to document-root, which in result closes one of my popup. I need to stop bubbling of the event and body or html are my only options to inte...

5

Solved

I'm building an Angular 2 ngrx/store application and trying to understand best practices. I love having an immutable state that changes only based on dispatched actions so that the app state is v...
Trestlework asked 16/6, 2016 at 18:26

2

Solved

I have not seen the source of this function, but I wonder, does it work like this: Selects element(s) by their selectors Delegates the provided event-handlers to them Runs a setInterval on that se...
Emmerich asked 27/2, 2013 at 12:23

4

Solved

If I click on the first "Edit" I get a console.log('click happend') But if I add a one of these boxes via javascript (click on "Add box") and then the Edit click from this new box does not work. I ...
Okechuku asked 31/7, 2017 at 14:1

3

Solved

I've attached delegated event handlers to a number of elements on the page using a single selector. As the events are triggered for individual elements, I'd like to turn off only that element's eve...
Shantay asked 28/5, 2015 at 16:31

3

Solved

Ok here the jsfiddle example http://jsfiddle.net/HTjCT/1/ As you can see you when you hover it is not firing mouseover event how can i solve this problem ? i am using Jquery 1.9 <div id='su...
Acnode asked 18/1, 2013 at 14:23

2

Solved

I have some markup like this (classes are just for explication): <ol id="root" class="sortable"> <li> <header class="show-after-collapse">Top-Line Info</header> <sect...
Squelch asked 11/1, 2012 at 22:10

1

Problem: I need to bind any number of event handlers to any number of elements (DOM nodes, window, document) at dynamically runtime and I need to be able to update event binding for dynamically cre...

7

Solved

I am trying to stop some events but stopPropagation does not work with "live" so I am not sure what to do. I found this on their site. Live events do not bubble in the traditional manner and ca...
Crusado asked 28/12, 2009 at 0:32

2

Solved

Is it considered bad practice to use jQuery's .on() event handler for every event? Previously, my code contained script like this: $('#cartButton').click(function(){ openCart(); }); However I'...
Junk asked 28/3, 2014 at 12:35

2

Solved

In jQuery, you can do the following: $('#j_unoffered').on('click', '.icon_del', function () {... This puts one handler on the element j_unoffered that fires if any descendant element with class ...
Longheaded asked 13/12, 2013 at 23:53

2

Solved

Would really appreciate if anyone can help me figure out why I am unable to fire events programmatically when using event delegation in MooTools (from the Element.Delegation class). There is a par...
Impuissant asked 22/4, 2010 at 7:41

2

Solved

UPDATE: (recap, fiddle and bounty) This question hasn't been getting too much attention, so I'm going to spend some rep on it. I know I tend to be overly verbose in both my answers and questions. ...

2

Solved

I have a scenario where I have some text, which should be user-selectable. The problem is, that there's an UI overlay on top of it, which prevents selecting text by default. The logical way to keep...
Feliciafeliciano asked 4/1, 2012 at 12:17

1

Solved

I have a visual list of items like this: http://jsfiddle.net/viatropos/XCe3T/1/ In the real app, I'm only loading 200 total items. But the problem is the click event takes almost one second to ca...
Fidelity asked 4/7, 2011 at 23:35

2

Solved

I was just reading http://api.jquery.com/event.stopPropagation/ Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propag...
Hereby asked 16/5, 2011 at 16:20

1

Solved

Reading another Stack Overflow question about jQuery performance, I started thinking about the point when it becomes worth using event delegation rather than binding to elements individually. I was...

1

Solved

I am currently setting up the jQuery validation plug-in for use in our project. By default, there are some events automatically set up for handling. I.e. focus in/out, key up events on all inputs ...
Slunk asked 4/5, 2010 at 2:28

3

Solved

Can any one please tell me the difference between target and currenttarget in flex?

© 2022 - 2024 — McMap. All rights reserved.