/*! * jQuery liveOne - v0.1 - 07/30/2010 * http://benalman.com/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ // The power of .live and .one, together at last! (function($,undefined){ '$:nomunge'; // Used by YUI compressor. $.fn.liveOne = function( types, data, fn ) { var that = this; if ( $.isFunction( data ) ) { fn = data; data = undefined; } function wrapper() { that.die( types, wrapper ); return fn.apply( this, arguments ); }; if ($.guid) { wrapper.guid = fn.guid = fn.guid || $.guid++; } return that.live( types, data, wrapper ); }; })(jQuery);