TinyMCE 自定义样式未应用(尽管技术上可行)
我在为客户处理的一些自定义表单上安装了最新的 TinyMCE(jquery 版本)。我创建了一个自定义样式文件,并将 init 更改为指向正确的文件(以及在必要时加载它)。
自定义样式已正确加载我的样式,并且它们可以工作,除了一件事。当您选择未样式化的文本时,并选择一个样式,根本没有任何反应。没有为我选择的文本分配新类(所有自定义 css 都是自定义类(带有 @font-face)。
但是,如果我打开 TinyMCE 的 HTML 部分并手动添加class="garbage",然后尝试分配一个样式,它会用正确的类替换垃圾,并且
当没有分配类时它根本不会更新
。首先修改其他元素(使其成为 h1,h2,以不同方式对齐等),但它仍然不会更新类,除非我先手动将其设置为任何内容。
I have the latest TinyMCE installed (jquery version) on some custom forms I'm working on for a client. I created a custom styles file, and changed the init to point to the correct file (as well as load it where necessary.
The custom styles are correctly loaded with my styles, and they work, except for one thing. When you select unstylized text, and select a style nothing happens at all. No new class is assigned to the text that I've selected (all the custom css is custom classes (with @font-face).
However, if I open the HTML portion of TinyMCE and manually add class="garbage", then try to assign a style, it replaces garbage with the correct class. The text & font updates correctly as well.
It just will not update at all when there is no class already assigned.
Note: Also tried modifying other elements first (making it h1,h2, aligned differently etc..) but it still will not update the class unless I set it to anything manually first.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您使用的是 jQuery 版本,我相信如果您以 jQuery 方式初始化并使用tinyMCE,您的问题将会得到解决,如下所示:
http://www.tinymce.com/wiki.php/jQuery_Plugin
而不是传统的 javascript 方式
As you are using the jQuery version, I believe your problem will be solved if you initialize and use tinyMCE the jQuery way, like so:
http://www.tinymce.com/wiki.php/jQuery_Plugin
and not the traditional javascript way