问题描述
我在页面中使用tinymce编辑器.我要做的是动态更改编辑器的高度.我创建了一个函数:
I am using tinymce editor in my page. What I want to do is to change the height of the editor dynamically. I have created a function:
function setComposeTextareaHeight()
{
$("#compose").height(200);
}
但这不起作用.我的文字区域是
but that is not working.My textarea is
<textarea id="compose" cols="80" name="composeMailContent" style="width: 100%; height: 100%">
我尝试了各种改变高度的方法,但无法解决.我有什么想念的吗?
I have tried all sorts of methods for changing the height but could not come to a resolution. Is there any thing that i am missing?
推荐答案
您可以使用resizeTo主题方法来调整tinymce的大小:
You can resize tinymce with the resizeTo theme method:
editorinstance.theme.resizeTo (width, height);
宽度和高度设置了编辑区域的新大小-我还没有找到一种方法来推断编辑器实例的额外大小,因此您可能需要执行以下操作:
The width and height set the new size of the editing area - I have not found a way to deduce the extra size of the editor instance, so you might want to do something like this:
editorinstance.theme.resizeTo (new_width - 2, new_height - 32);
这篇关于动态更改tinyMce编辑器的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!