@@ -756,10 +756,15 @@ if ( document.addEventListener ) {
});
}
jQuery.each(["bind", "one"], function( i, name ) {
jQuery.fn[ name ] = function( type, data, fn ) {
+
+ if ( this.isLive && name === "bind" ) {
+ return this.live(type, data, fn);
+ }
+
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ name ](key, data, type[key], fn);
}
@@ -782,12 +787,32 @@ jQuery.each(["bind", "one"], function( i, name ) {
jQuery.event.add( this, type, handler, data );
});
};
});
+function jQueryLive( selector , context ) {
+ jQuery.extend(this,{
+ selector: selector,
+ context: context,
+ length: 0,
+ isLive: true
+ });
+}
+
+jQueryLive.prototype = jQuery.fn;
+
+jQuery.live = function( selector , context ) {
+ return new jQueryLive( selector , context );
+};
+
jQuery.fn.extend({
unbind: function( type, fn ) {
+
+ if ( this.isLive ) {
+ return this.die(type, data, fn);
+ }
+
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
$.live(".subElements","#parent").click(functor).hover(functorIn,functorOut);