It's now possible to trigger default events like .click(), .submit(), .focus(), etc. Using the jQuery event trigger.

This commit is contained in:
John Resig 2007-01-02 17:34:56 +00:00
parent 0ae7198b9e
commit 4805a45c06

View file

@ -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 );
}
}
},