TinyMCE宽度和高度不听话! [英] TinyMCE width and height disobedient!

查看:2174
本文介绍了TinyMCE宽度和高度不听话!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据TinyMCE的(冲突的)文档,编辑器会采用它替换的textarea(或其他)元素的大小。它还说你可以通过在 init <中指定 {height:'123',width:'123'} 来设置编辑器的大小/ code>方法。

According to the (conflicting) documentation of TinyMCE, the editor takes on the size of the textarea (or other) element that it replaces. It also says that you can set the size of the editor by specifying { height: '123', width: '123' } in the init method.

我已经尝试了两次并且仍然只得到一个结果 - 编辑器调整自身(它记得如何超出我)它是什么用户最后一次调整大小。

I have tried BOTH and still get only one result - the editor resizes itself to (how it remembers is beyond me) what it was the last time a user resized it.

推荐答案

我知道这一切, 非常讨厌。

I know all about this, it is very annoying.

将此添加到任何加载的CSS文件中为我修复了宽度(我只是将它放在全局css中,而不是在任何TinyMCE css文件中,我没有高度测试):

Adding this to any loaded CSS file fixed the width for me (I just put it in the global css, not in any of the TinyMCE css files, I did not test with height):

.mceEditor > table {
    width:/* my width */ !important;
}

这会影响所有实例,在我的情况下这很好。您可以使用 .mceToolbar定位工具栏本身

This would affect all instances, which was fine in my case. You can target the toolbar itself with .mceToolbar

您想要想要TinyMCE调整textarea的大小,因此它可以足够宽以适应所有工具栏图标。

You kind of do want TinyMCE to resize the textarea, so it can be wide enough to fit all the toolbar icons.

这篇关于TinyMCE宽度和高度不听话!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆