本文介绍了如何使用调色板在CKEditor中更改容器的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用内联ckeditor从颜色列表中更改容器的颜色。我知道我们有 colorbutton插件来更改块元素的文本颜色和背景色,但我需要更改整个容器的颜色。
How to change the color of the container with inline ckeditor from the list of colors.I know we have "colorbutton" plugin to change the text color and background color of block element but I need to change the entire container color.Here is the image about my requirement
推荐答案
修改了colorbutton按钮ckeditor插件。
在renderColors()方法中添加以下条件。
Modified the colorbutton button ckeditor plugin.Add the following conditions in renderColors() method.
if(type != 'back'){
editor.applyStyle( new CKEDITOR.style( colorStyle, { color: color } ) );
}else{
editor.container.$.style.backgroundColor=color;
}
这篇关于如何使用调色板在CKEditor中更改容器的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!