Hi,

Seems I cannot use the live() method to bind events when I define a
new Jquery function

this code is working very well:

jQuery.fn.isExpandable = function() {
        return this.each(function(){
                $(this).css('overflow','hidden');
                $(this).keyup(function(){
                        el_id = $(this).attr('id');
                        el_scroll_height = 
document.getElementById(el_id).scrollHeight;
                        $(this).css('height',el_scroll_height+'px');
                });
        });
};

if I use live() to bind the event it doesn't work anymore!

jQuery.fn.isExpandable = function() {
        return this.each(function(){
                $(this).css('overflow','hidden');
                $(this).live('keyup',function(){
                        el_id = $(this).attr('id');
                        el_scroll_height = 
document.getElementById(el_id).scrollHeight;
                        $(this).css('height',el_scroll_height+'px');
                });
        });
};


Any idea?

Andrea

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to