This should work: $('#myTextarea').unbind(); // unbinds all handlers
Then when you want to bind it again: $('#myTextarea').expandable(); -- Josh -----Original Message----- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Friday, February 13, 2009 11:43 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How to make an element *not* have a function attached... To answer your question, hopefully, the element, in this case a textarea, is set up like this: <script> $(function() { $('#myTextarea').expandable(); }); </script> ...and that's it. It would be active as "expandable" all the time. So, there's no "event", like click, etc., that triggers the function. However, I want to be able to click a link and disable the "expandable" functionality, until another link is clicked to re-enable the functionality. In other words, having the textarea "expandable" is not something I want on all the time. > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Frederik Ring > Sent: Friday, February 13, 2009 2:04 PM > To: jQuery (English) > Subject: [jQuery] Re: How to make an element *not* have a function attached... > > > This should be done using $(this).unbind(event,function). > I don't know from your example how your handle the event so I cannot > give you a more specific answer. > > On Feb 13, 7:57 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote: > > Strange question, perhaps...but... > > > > If I have an element that has an function from a plug-in > > attached to it, such as: > > > > $(function() { > > $('#myTextarea').expandable(); > > > > }); > > > > How would I then be able to make #myTextarea "not .expandable"... > > > > $('#myTextarea').expandable('disable'); ... > > > > Is this something that can be controlled from the page code, or > > does something have to be built into the plug-in to allow this? > > > > Thanks, > > > > Rick