繁体   English   中英

在TinyMce中,当焦点对准编辑器时如何更改容器的颜色?

[英]In TinyMce, how to change the color of the container when the editor in focus?

要使其看起来像是突出显示的编辑器? TinyMCE的版本是今天的最新版本4.3.2。

我认为这应该很简单。 我已经在Google TinyMce论坛上进行了搜索。 但是我没有找到答案。

检查CSS, mce-edit-focus是激活编辑器时使用的类。

根据他们的文档,您可以在编辑器的setup函数中添加事件处理程序。

setup: function(editor) {

    editor.on('focus', function(e) {
      $(e.target.container).find('.mce-edit-area').toggleClass('focused');
    });

    editor.on('blur', function(e) {
      $(e.target.container).find('.mce-edit-area').toggleClass('focused');
    });
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM