brandonaaron / livequery

MIT License
477 stars 195 forks source link

'livequery' should be an event #3

Closed elijahr closed 11 years ago

elijahr commented 14 years ago

It would be really useful if one could bind livequery callbacks as event handlers. This would allow for namespacing.

An example:

$('div').bind('livequery.foo', function(event){ alert('foo') }) $('div').bind('livequery.bar', function(event){ alert('bar') }) $('

').appendTo(document.body) // alerts foo, then alerts bar $('div').unbind('livequery.foo') $('
').appendTo(document.body) // alerts only bar