/*! * jQuery oneOnly - v0.1pre - 03/30/2011 * http://benalman.com/ * * Copyright (c) 2011 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($){ $.fn.oneOnly = function( types ) { var elems = this, args = Array.prototype.slice.call(arguments), fn = args.pop(); function handler() { elems.unbind(types, handler); return fn.apply(this, arguments); } return this.bind.apply(this, args.concat(handler)); }; })(jQuery);