Skip to content
Permalink
Browse files

It's now possible to trigger default events like .click(), .submit(),…

… .focus(), etc. Using the jQuery event trigger.
  • Loading branch information
jeresig committed Jan 2, 2007
1 parent 0ae7198 commit 4805a45c0669b298c24005ce6505b49d88f85fe7
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/event/event.js
@@ -82,11 +82,15 @@ jQuery.event = {

// Handle triggering a single element
} else if ( element["on" + type] ) {
// Pass along a fake event
data.unshift( this.fix({ type: type, target: element }) );

// Trigger the event
element["on" + type].apply( element, data );
if ( element[ type ] && element[ type ].constructor == Function )
element[ type ]();
else {
// Pass along a fake event
data.unshift( this.fix({ type: type, target: element }) );

// Trigger the event
element["on" + type].apply( element, data );
}
}
},

0 comments on commit 4805a45

Please sign in to comment.
You can’t perform that action at this time.