- // use bind with amount param to bind only once
- return this.bind(o, f, 1);
+ // save cloned reference to this
+ var element = jQuery(this);
+ var handler = function() {
+ // unbind itself when executed
+ element.unbind(o, handler);
+ element = null;
+ // apply original handler with the same arguments
+ f.apply(this, arguments);
+ };
+ return this.bind(o, handler);