Questions tagged [jquery-trigger]

JQuery Method that Triggers all events bound to the selected elements

Execute all handlers attached to an element for an event without performing the default action of the browser, the transfer event or live events.

This method behaves like the trigger, but there are two major differences:

  • First, doesn't not call the default action of the browser, called event is not reported and live events are also not called.

  • Second, the event is only the first element in the collection jQuery. This method returns an object caused by the handler, jQuery. Also, if the jQuery collection is empty, it returns undefined.

42 questions
35
votes
4 answers

triggerHandler vs. trigger in jQuery

Out of curiosity -- what is the purpose of / use cases for jQuery's triggerHandler? As far as I can tell, the only "real" differences between trigger and triggerHandler is whether or not the native event fires, and event bubbling behavior (though…
19
votes
3 answers

Triggering click event on anchor tag doesn't work

I just ran into this question FIDDLE Triggering click event on anchor tag is not working here. hello
8
votes
2 answers

jquery triggerHandler doesn't work while trigger does

I am adding a click event to a checkbox which will show/hide additional fields depending on its checked status. I want the handler to fire on load to set up the initial page structure. For some reason triggerHandler is not working on the field. If…
3
votes
2 answers

jQuery programatically click a tag that has javascript:void(0)

I am trying to programmatically click the "zoom in" icon three times on a page. The is structured:   I have the following code, called on document…
troyrmeyer
  • 125
  • 1
  • 10
3
votes
1 answer

jQuery trigger('click') Not Working in Chrome

I previously had the following $('#refresh').click(function () { $('#fileUpload').trigger('click'); }); However I've changed it so it should fire on a query parameter function getParameterByName(name) { name = name.replace(/[\[]/,…
pee2pee
  • 3,619
  • 7
  • 52
  • 133
2
votes
1 answer

Need to pass specific JQueryEventObject AND parameters to trigger

I am using custom events to broadcast navigation messages (between related plugins). The simple trigger code currently looks like this: $button.trigger('navigate', { url: link, target: target }); The receiving code looks…
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
2
votes
2 answers

jQuery Selector only on first level not working?

I have a simple list with a sublist
2
votes
1 answer

Why jQuery triggerHandler() works but trigger() doesn't?

Click an element using triggerHandler() works: $element = $('#gwt-debug-location-pill-edit-div:visible'); $element.triggerHandler('click'); But, clicking it using trigger(), doesn't: $element.trigger('click'); Why is that? To replicate this (in…
1
vote
2 answers

How can I pass a parameter/argument to the onchange listener that is programmatically triggered by a call to click

In my form in one set of repeating rows (created dynamically) there is a button on each row that allows the user to upload a file which will then be linked/tied to the data in that row. head head upload ---- ---- -------- x y …
Peter Bowers
  • 3,063
  • 1
  • 10
  • 18
1
vote
2 answers

Selecting all elements except for div not working with jQuery

I'm trying to select all elements in the document except for the #private_chat_menu element and attach a mouseup trigger function to them. However, it runs the function regardless of whether I click a select box inside the #private_chat_menu…
Daniel Harris
  • 1,805
  • 10
  • 45
  • 63
1
vote
2 answers

Passing parameters to $(window).on('resize') when using .trigger('resize')

I need a reliable way to detect if $(window).on('resize') has been fired by user interaction or by a jQuery .trigger call. I've tried the following, but I don't seem to get the parameters back in the function…
Jonny Asmar
  • 1,900
  • 14
  • 16
1
vote
1 answer

Passing global variable in javascript to live event on jquery does not work

I have created several elements dynamically in javascript. These are, among others, range inputs. I want on "input change" event to show the value. Each of these inputs have id like 'probabilitate'+number. The number is a global variable, and is…
1
vote
0 answers

jQuery trigger performance

I have a performance issue with jquery trigger. My code contains this line $(ispan).trigger('click','itoc'); //ispan is a img element Here the total time taken to execute this line of code is almost 3 seconds. ispan is only one element. I have…
1
vote
0 answers

any reason why trigger function is not working? (jquery)

I have the code below. When I trigger #tempbutton from #searchbutton (with an object as a parameter), it works fine. But when I'm doing the same thing from #myid, it won't trigger. Any ideas what I could be doing wrong? Thanks Here's my code. Please…
mrjayviper
  • 2,258
  • 11
  • 46
  • 82
1
vote
3 answers

jquery trigger('click') is not working in safari with angular js

Jquery trigger('click') is not working on Safari and IE, but working on Mozilla , chrome, I Am using AngularJS and here is my code snippet $scope.browseFile = function () { $('.upfile').trigger('click'); console.log('click','fired…
1
2 3