[jQuery] Re: How to make an element *not* have a function attached...

2009-02-14 Thread QuadCom
Here's my understanding. unbind will work for events. The expandable function you applied is not an event. What I would do in this instance is on the hide button, remove the textarea with the expandable and then insert a new textarea with the same id. That would appear to remove the expandable

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-14 Thread QuadCom
Actually an even easier trick would be to have 2 textareas that mirror each others content. Hide one without the expandable. Show the other with expandable. On the hide button, just do a reversal, show the noexpandable, hide the expandable. You can add a check on the submit of the form to delete

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-14 Thread Rick Faircloth
Thanks for the tips! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of QuadCom Sent: Saturday, February 14, 2009 2:19 PM To: jQuery (English) Subject: [jQuery] Re: How to make an element *not* have a function attached...

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-13 Thread Frederik Ring
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

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-13 Thread Rick Faircloth
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.,

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-13 Thread Frederik Ring
Ok, then you could do it like this: script type=text/javascript $(document).ready(function(){ $('#mytextarea').each(function(){ $(this).expandable(); }); $('#myButton').click(function(){ $('#mytextarea').unbind(); }); }); /script Although I might think there is a more elegant way to do

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-13 Thread Josh Nathanson
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

[jQuery] Re: How to make an element *not* have a function attached...

2009-02-13 Thread Rick Faircloth
Nice try, but no prize yet... Given these scripts: $(document).ready(function() { $('#myTextarea').hide(); }); $(document).ready(function() { $('#hide').click(function() { $('#myTextarea').unbind().slideUp(); return false; }); });