jquery - 可编辑文本框宽度

标签 jquery jeditable

使用 jeditable 进行内联替换时,是否可以使文本框大于文本。我想给用户空间在现有文本之上添加新文本。

最佳答案

您可以在设置中指定高度宽度,以将文本框设置为特定的高度和宽度。 还有一个函数回调onedit,您可以连接它来设置编辑框的特定大小 这不起作用

<span id="edit">hello world!</span>

<script type="text/javascript">
 $(document).ready(function(){
 $("span#edit").editable("....",
 {
            event: "click",
            style: "inherit",
            onblur: "submit",
            width:($("span#edit").width() + 200) + "px", // THIS DOES THE TRICK
            height:($("span#edit").height() + 100) + "px", //THIS DOES THE TRICK
            placeholder: "Click to set text",
            tooltip: "Click to update"
        });
   });
</script>

关于jquery - 可编辑文本框宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1458128/

相关文章:

jquery - 允许在可编辑环境中编辑日期时间值的最佳方法?

django jeditable 不工作

javascript - 如果未加载则加载 jQuery - 失败的方法

javascript - 如何在codeigniter中使用ajax jquery将页面重定向到另一个页面?

javascript - 单击链接时显示/隐藏 Div

jquery - 如何在 jQuery 可编辑文本输入中设置样式

javascript - 如何使用jquery向html元素添加或减去数字

javascript - 如何将字符串变量传递给 Morris.js 中的 labels 选项

jQuery dataTables makeEditable() 不是函数

jquery - 如何设置可编辑文本最大长度?