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
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
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...
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
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.,
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
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
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;
});
});
8 matches
Mail list logo