Reputation: 37406
I have the following code:
var oldFocus = $.fn.focus;
$.fn.focus = function () {
// how to get event here?
return oldFocus.apply(this, arguments);
};
how can I get at the event object?
Update: using jquery 2.0.3
Upvotes: 1
Views: 66
Reputation: 290
$.event.special.focus = {
trigger: function(e){
console.log(e);
return false; // if false, focus is not firing
}
};
Try this code.
Edit by OP:
pushOK's code is the starting point i needed. What i needed to achieve my objective detailed in the comments below was:
$.event.special.focus = {
trigger: function(e){
e.preventDefault();
return true;
}
};
Upvotes: 1