JQuery document ready and ajax -
I have to resize my page's textair tags, in which the class is: textAreaGroup
only the first two
I have this code:
jQuery (document) .ready (function () {var orig_h; jQuery (".textAreaGroup"). ("Focus" Function () {orig_h = jQuery (this) .it (); jQuery (this) .it (jQuery (this) [0] .scrollHeight);}). ('Blurred', function () {jQuery ('TextEregr '). Height (orig_h)});}); It works only with two first textare tags, and it is not applicable for new people loaded by Ajax.
What should I do to provide this code for all textare tags?
You can try this, where you have set the selector inside the function Event delegation: < ('click', '*', function () {if (this.nodeName === " Textea ") {var hght = this.scrollHyight; jQuery (this) .css ({'height': hght + 'px'})} Other {jQuery ('textarea'). Attr ('style', ''); }}}});
Even if it is not using focus () and blurring () events, the result will be similar. A ...
Comments
Post a Comment