就地编辑 JQuery UI 文本区域可编辑的调整大小如何工作?

发布于 2024-10-31 03:45:10 字数 928 浏览 1 评论 0原文

我在将 JQuery 就地编辑文本区域设置为固定大小时遇到​​问题。

基本上我有一个 HTML 文件,其中一部分有一个名为 editable-large 的段落:

<div class="profile">
   <h2>About Me</h2>
   <p class="editable-large">
         Ansel Easton Adams (February 20, 1902 – April 22, 1984) was an American photographer and environmentalist, best known for his black-and-white photographs of the American West, especially in Yosemite National Park.
   </p>
</div>

并且我有一个与该段落关联的 JQuery JS 文件,允许就地编辑它。因此,每当有人单击该段落时,它就会变成一个文本区域。

$(".editable-large").editable(
    {  submit: "Save",
       cancel: "Cancel",
       type: "textarea",
       options: {"cols": 80, "rows": 10},
    }).css({"cols": 80,"rows": 10});

我希望文本区域具有一定的宽度和高度(80 和 10),但无论我输入什么值,它总是相同的大小,看起来像 这个。我非常感谢任何帮助使该文本区域具有固定大小的帮助。

I have problems getting a JQuery Edit-In-Place textarea to be a fixed size.

Basically I have one HTML file, part of which has a paragraph named editable-large:

<div class="profile">
   <h2>About Me</h2>
   <p class="editable-large">
         Ansel Easton Adams (February 20, 1902 – April 22, 1984) was an American photographer and environmentalist, best known for his black-and-white photographs of the American West, especially in Yosemite National Park.
   </p>
</div>

And I have a JQuery JS file associated with that paragraph that allows it to be edited in place. So whenever someone clicks on the paragraph, it turns into a textarea.

$(".editable-large").editable(
    {  submit: "Save",
       cancel: "Cancel",
       type: "textarea",
       options: {"cols": 80, "rows": 10},
    }).css({"cols": 80,"rows": 10});

I want the textarea to have a certain width and height (80 & 10), but no matter what values I put in, it's always the same size and looks like this. I'd greatly appreciate any help in making that textarea a fixed size.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

画▽骨i 2024-11-07 03:45:10

您可以通过给文本区域指定宽度和高度来实现这一点,例如:

textarea{
    width:100px;
    height:50px;
}

You can do that be giving your textarea a width and height ex:

textarea{
    width:100px;
    height:50px;
}
筑梦 2024-11-07 03:45:10
$(".editable-large").editable(
    {  submit    : "Save",
       cancel    : "Cancel",
       type      : "textarea",
       width     : '100',
       height    : '50'
    }
);
$(".editable-large").editable(
    {  submit    : "Save",
       cancel    : "Cancel",
       type      : "textarea",
       width     : '100',
       height    : '50'
    }
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文