jQuery: The Write Less, Do More JavaScript Library

Ticket #2141 (new enhancement)

Opened 7 months ago

Last modified 3 months ago

Make shortcut syntax for the focus and the blur event

Reported by: DarkAngelBGE Assigned to: anonymous
Type: enhancement Priority: minor
Milestone: 1.2.4 Component: event
Version: 1.2.1 Keywords:
Cc: Needs: Test Case

Description

Possible usage:

$obj.focus(

function() {}, // for focus event function() {} // for blur event

);

Something like:

(function($) {

var _focus = $.fn.focus; $.fn.focus = function(focus, blur) {

_focus.call(this, focus); if (blur) {

this.blur(blur);

}

};

}(jQuery));

not tested

This is really like the .hover(callback, callback) thing :)

Attachments

Change History

Changed 4 months ago by scott.gonzalez

  • owner deleted
  • component changed from interface to event

Changed 3 months ago by flesler

  • need changed from Review to Test Case
  • milestone changed from 1.2.2 to 1.2.4

Could you a consistent test case where this is useful ?

Note: See TracTickets for help on using tickets.