Emulation of jquery .live() method.



jQuery.fn.live = function(ob) { var selector = (this.selector); for(i in ob) $(this).each(function(index) { $(document).undelegate(selector,i).delegate(selector, i,ob[i]); }); };

Example:

$(selector).live({
  'click':           function(){ /*do something*/ },
  'mouseover': function(){ /*do something*/ },
  'mouseout':   function(){ /*do something*/ }
});

Comments

Popular posts from this blog

Using Debian on linksys NAS-200

Малко за мъката по светът.