X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fevent%2Fevent.js;h=81c193980bc16d7a8bc98b5a041e0dd285d0cac8;hb=43f235f4257359dfcf9270cf31c56aa547d01fd3;hp=812d6f268357809a3bb80e7fa272405ff1661ea9;hpb=d2f9022a8ebbfadeb6a329714a607d2dc2882769;p=jquery.git diff --git a/src/event/event.js b/src/event/event.js index 812d6f2..81c1939 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -69,7 +69,7 @@ jQuery.event = { this.remove( element, j ); }, - trigger: function(type,data,element) { + trigger: function(type, data, element) { // Clone the incoming data, if any data = jQuery.makeArray(data || []); @@ -313,9 +313,19 @@ jQuery.fn.extend({ * @before

Hello

* @result alert('hello') * + * @example $("p").click(function(event, a, b) { + * // when a normal click fires, a and b are undefined + * // for a trigger like below a refers too "foo" and b refers to "bar" + * }).trigger("click", ["foo", "bar"]); + * @desc Example of how to pass arbitrary to an event + * + * @before

Hello

+ * @result alert('hello') + * * @name trigger * @type jQuery * @param String type An event type to trigger. + * @param Array data (optional) Additional data to pass as arguments (after the event object) to the event handler * @cat Events */ trigger: function( type, data ) {