Javascript 调整jHtml文本区域的大小

Javascript 调整jHtml文本区域的大小,javascript,jquery,wysiwyg,jhtmlarea,Javascript,Jquery,Wysiwyg,Jhtmlarea,我想调整JHTMLTextArea的大小,就像调整普通文本区域一样,所以有没有调整大小的方法 以下是创建jHtml文本区域的代码 以下是HTML代码: <table style="width: 100%; border-collapse: separate !important; border-spacing: 2px!important"> <tr> <td> <%=Html.LabelFor(m => m.Descrip

我想调整JHTMLTextArea的大小,就像调整普通文本区域一样,所以有没有调整大小的方法

以下是创建jHtml文本区域的代码

以下是HTML代码:

<table style="width: 100%; border-collapse: separate !important; border-spacing: 2px!important">
<tr>
    <td>
        <%=Html.LabelFor(m => m.Description)%>
    </td>
    <td>
        <%=Html.TextAreaFor(m => m.Description, new { @class="form-control",style="width: 610px; height: 150px" })%>
    </td>
</tr>
</table>

m、 说明)%>
m、 说明,新的{@class=“form control”,style=“width:610px;height:150px”})%>
下面是javascript代码:

<script type="text/javascript">
   $(function () {
    $("#Description").htmlarea({
        // Override/Specify the Toolbar buttons to show
        toolbar: [
            ["bold", "italic", "underline", "|", "forecolor"],
             ["p", "h3", "h4", "h5", "h6"],
              ["link", "unlink", "|", "image"],
              ["orderedlist", "unorderedlist"],
              ["increasefontsize", "decreasefontsize"],
              ["indent", "outdent"],
              ["justifyleft", "justifycenter", "justifyright"],
              ["cut", "copy", "paste"]
        ]
    });
});
</script>

$(函数(){
$(“#说明”).htmlarea({
//覆盖/指定要显示的工具栏按钮
工具栏:[
[“粗体”、“斜体”、“下划线”、“前景色”],
[“p”、“h3”、“h4”、“h5”、“h6”],
[“链接”、“取消链接”、“|”、“图像”],
[“有序列表”、“无序列表”],
[“增大字体大小”、“减小字体大小”],
[“缩进”,“缩进”],
[“justifyleft”、“justifycenter”、“justifyright”],
[“剪切”、“复制”、“粘贴”]
]
});
});

我的猜测是,通过使用css规则,您可以轻松实现所需的行为,如下面的代码片段所示:

#注释{
位置:绝对位置;
宽度:60%;
高度:200px;
}

我的文本。
您可以通过添加jHtmlarea的“resizable”属性来实现该行为。愿它能帮助你

<script type="text/javascript">
   $(function () {
     $("#Description").htmlarea({           
          toolbar: [
             ["bold", "italic", "underline", "|", "forecolor"],
             ["p", "h3", "h4", "h5", "h6"],
             ["link", "unlink", "|", "image"],
             ["orderedlist", "unorderedlist"],
             ["increasefontsize", "decreasefontsize"],
             ["indent", "outdent"],
             ["justifyleft", "justifycenter", "justifyright"],
             ["cut", "copy", "paste"]
         ]
     }).parent().resizable({ alsoResize: $("#comm").find('iframe') });
  });
</script>

$(函数(){
$(“#说明”).htmlarea({
工具栏:[
[“粗体”、“斜体”、“下划线”、“前景色”],
[“p”、“h3”、“h4”、“h5”、“h6”],
[“链接”、“取消链接”、“|”、“图像”],
[“有序列表”、“无序列表”],
[“增大字体大小”、“减小字体大小”],
[“缩进”,“缩进”],
[“justifyleft”、“justifycenter”、“justifyright”],
[“剪切”、“复制”、“粘贴”]
]
}).parent().resizeable({alsoResize:$(“#comm”).find('iframe')});
});

嘿,谢谢你的回答,但这不是正常的文本区域。这是jHtmlarea,我已经试过了。不起作用。是的,但htmlarea的位置可以通过css进行调整…代替textarea的可以是任何其他元素,如果添加一些html布局就更好了。。