Questions tagged [jquery-delegate]

`.delegate()` is a function within jQuery JS framework, that attaches events to the specified elements within specified existing root element, even if they do not exist at the time events are attached.

.delegate() works similarly to .live() and is documented on the jQuery documentation page for .delegate().

31 questions
0
votes
1 answer

JQuery event handler for child element triggers after parent when document.delegate used

I used the below html code for checking how the event bubbling works. I added the event handler for child element using $(document).delegate and for parent and super element I used HTML event attributes for handling click events. Generally when…
0
votes
2 answers

Angularjs+jquery bootstrap-datepicker delegate not firing on first click

I have tried adding the datepicker dynamically on button click and I have delegated the datepicker click which is not working on the first click its getting fired on the second click the code I have tried are the following $scope.add = function() …
0
votes
4 answers

Access the element before the current element in jQuery

I have the following HTML table.
Ashif Shereef
  • 454
  • 1
  • 8
  • 24
0
votes
1 answer

Make a delegated jQuery Auto-complete

I am using the following code to create an auto-complete textbox. The jQuery is as follows. $(function() { $( "#items .slno" ).autocomplete({ source: 'search.php' }); }); The HTML is as follows.
Ashif Shereef
  • 454
  • 1
  • 8
  • 24
0
votes
0 answers

changing dynamic content using JQuery .on or .delegate where the selector is not the dynamic content

Everywhere I look for examples for delegated clicking, everyone assumes the button is dynamic. Scenario: I have a list of div elements that get created dynamically. I have a button. outside of the list. The button works on the list, until it…
0
votes
1 answer

How to find delegated event listeners?

Normally to get listeners on that DOM node I am using $('selector').data('events'); However this does not show event listeners that are being add via delegation, e.g $(document).on('click', 'selector', handlerFunction) One obvious way is to…
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
0
votes
1 answer

If function_1 contains $.each() functions and an on("load") function, how to make function_2 run afterwards?

I've spent the day reading about deferred, done, promise and callbacks as they seemed relevant to my problem, as well as the many posts on 'how do i run function_2 after function_1' etc. So I understand the concept that when things happen…
user1063287
  • 10,265
  • 25
  • 122
  • 218
0
votes
1 answer

Remove delegate event from a changed element

I have a modal which content is dynamic, and this modal has a reject button. This modal itself is generated dynamically via a link, so I have to use delegate $( "body" ).delegate( ".reject", "click", function(e) { $(".modalInfo").hide(); …
a0z0ra
  • 171
  • 1
  • 9
0
votes
2 answers

how to attach hover handler to TD elements, filtering on a class selector that may be applied in the future

My table will have a number of TD elements that get assigned a class, .foo, during the course of the user working with the data. The table might have a few hundred cells and only a dozen of those may acquire the .foo class. I want to listen for…
Tim
  • 8,669
  • 31
  • 105
  • 183
0
votes
0 answers

JQuery delegate command does not seem to be working

I have a fieldset that contains a bunch of input elements and which is initially collapsed when displayed to the user. I would like to attach an event handler on the a drop down list that is contained in the fieldset but I seem to be having trouble…
user5013
  • 981
  • 4
  • 10
  • 21
0
votes
1 answer

How can I filter some content added dynamically with jQuery?

First of all, sorry for my english, I'm still learning :). My problem is the next, I have added some HTML content dinamically with jQuery, specifically these inputs:
Yonirt
  • 165
  • 2
  • 2
  • 11
0
votes
2 answers

trouble getting .on function to work as it is supposed to

I have an html page with the following html: Going to a page that has the following js doesn't return any alert: $("#content").on(".pagination a",…
Nachshon Schwartz
  • 15,289
  • 20
  • 59
  • 98
0
votes
0 answers

jQuery delegate and custom events

I'm having issues binding a custom event to a delegate control Any normal day I use the plugin like this $(".galleryImage").swipe({ swipeLeft: function (event, direction, distance, duration, fingerCount) { …
Eric Herlitz
  • 25,354
  • 27
  • 113
  • 157
0
votes
2 answers

Delegate in jquery is not working as expected

I have used two div and defined click event for their inner element using delegate in jquery 1.7.2. first click event is working fine as expected and second is not working. $("#first").delegate(".ask div:first","click",function(e){ …
YogeshWaran
  • 2,291
  • 4
  • 24
  • 32
0
votes
2 answers

jQuery toggle not working with duration

I have a dynamically generated panel that slides in and out from the right when a trigger is clicked. Here is the HTML:
Brett
  • 721
  • 2
  • 10
  • 20