0

「 jQuery Autosize !」というプラグインを使用しています。私のテキストエリアに。サーバー側で生成されたテキストエリアは、ページが既に読み込まれているときに生成されるため、自動サイズ変更するにはどうすればよいですか。

これは、サーバー側のテキストエリアを生成するコードです。resultErrorObj.node_html以下に示すように、サーバー側で生成されたテキストエリアが含まれています。

$(document).ready(function() {
$("#postUpdate").submit(function(event){
      // setup some local variables
      var $form = $(this),
          // let's select and cache all the fields
          $inputs = $form.find("input"), 
          // serialize the data in the form
          serializedData = $form.serialize();
      // let's disable the inputs for the duration of the ajax request
      $inputs.attr("disabled", "disabled");
      // fire off the request to /form.php
      $.ajax({
          url: base_url + "ajax/post_status_update",
          type: "post",
          data: serializedData,
          // callback handler that will be called on success
          success: function(response, textStatus, jqXHR){
                    var resultErrorObj = jQuery.parseJSON(response);
                    if (resultErrorObj.status == 1)
                    {           $(resultErrorObj.node_html).hide().insertAfter('#activitiesStream').slideDown('fast');
            }
            else
            {
                alert(resultErrorObj.error);
            }
          },
          // callback handler that will be called on error
          error: function(jqXHR, textStatus, errorThrown){
              // the error 
              alert("Error here " + errorThrown);
          },
          // callback handler that will be called on completion
          // which means, either on success or error
          complete: function(){
              // enable the inputs
              $inputs.removeAttr("disabled");
          }
      });

      // prevent default posting of form
      event.preventDefault();
});

});

ありがとうございました!

4

1 に答える 1

0

AutosizeのWebサイト(http://jacklmoore.com/autosize)は、自動サイズ設定を手動でトリガーできることを示しています。

于 2013-03-07T09:28:13.870 に答える