$.fn and live method seems are not working together
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