It's now possible to trigger default events like .click(), .submit(), .focus(), etc. Using the jQuery event trigger.
This commit is contained in:
parent
0ae7198b9e
commit
4805a45c06
1 changed files with 9 additions and 5 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue