调整 Html 文本区域的大小
Resize jHtml text area
我想像普通文本区域一样调整 jHtml TextArea 的大小,所以有什么方法可以调整大小。
以下是创建jHtml Textarea的代码。
这里是 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>
下面是 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>
我的猜测是,您可以通过使用 css 规则 轻松实现所需的行为 ,如下面的代码片段所示:
#Comments {
position:absolute;
width:60%;
height:200px;
}
<textarea id="Comments">My text.</textarea>
您可以通过添加 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>
我想像普通文本区域一样调整 jHtml TextArea 的大小,所以有什么方法可以调整大小。
以下是创建jHtml Textarea的代码。
这里是 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>
下面是 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>
我的猜测是,您可以通过使用 css 规则 轻松实现所需的行为 ,如下面的代码片段所示:
#Comments {
position:absolute;
width:60%;
height:200px;
}
<textarea id="Comments">My text.</textarea>
您可以通过添加 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>