[jQuery] Re: Unbinding event for specific element after binding for entire document

2008-06-11 Thread nandu
On Jun 11, 11:38 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > Hi > > No, I mean that if you call bind() on the document, you only add the > event handler to the document. Not to every element in it. > The reason it reacts to a click everywhere is "event bubbling" (google > it). > > I said that

[jQuery] Re: Unbinding event for specific element after binding for entire document

2008-06-11 Thread Ariel Flesler
Hi No, I mean that if you call bind() on the document, you only add the event handler to the document. Not to every element in it. The reason it reacts to a click everywhere is "event bubbling" (google it). I said that you should bind to the document, and then, inside the function, figure out wh

[jQuery] Re: Unbinding event for specific element after binding for entire document

2008-06-11 Thread nandu
On Jun 10, 11:21 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > When you bind the document, you just bind the document, not all its > elements. So you can't unbind afterwards. > > You need to use conditions (.is() to skip clicks on textareas from > that handler. > > if( this.nodeName == 'TEXTAREA'

[jQuery] Re: Unbinding event for specific element after binding for entire document

2008-06-10 Thread Ariel Flesler
When you bind the document, you just bind the document, not all its elements. So you can't unbind afterwards. You need to use conditions (.is() to skip clicks on textareas from that handler. if( this.nodeName == 'TEXTAREA' ) // or $(this).is('textarea') return; -- Ariel Flesler http://flesl