动态添加内容样式到 CKEditor 4 实例
Dynamically add contents style to CKEditor 4 instance
>我已经使用 contentsCss
选项将 CSS 文件路径传递给我的 CKEditor 实例,效果很好。 但是,我需要能够动态添加更多无法在 CSS 文件中添加的样式。 在版本 3 中,看起来可以使用 addCss
函数(请参阅此论坛帖子)。 不幸的是,这似乎在版本 4 中不起作用(请参阅此论坛帖子)。 有人有其他选择吗?我正在使用jQuery适配器,因此使用任一API的解决方案都可以使用。
我认为你可以做类似的事情
$(window).on('print',function(e){
e.preventDefault();
var styles = '<style>'+/*calculation of styles*/+'</style>'
$('head').append(styles);
window.print();
});
或
$(window).on('load',function(e){
var styles = '<style>'+/*calculation of media query print styles*/+'</style>'
$('head').append(styles);
});
相关文章:
- CKEditor新实例始终处于卸载状态
- 删除所有CKEditor实例
- 查找ckeditor实例
- CkEditor没有销毁实例
- 如何将占位符属性添加到 CKEditor 的实例
- CKEditor:如何重置或重用实例
- 如何为具有不同高度的多个实例设置CKEditor
- JQuide对话框中的ckeditor实例
- CKEditor实例Ready在Eclipse Nebula中不起作用
- 如何防止 Ckeditor 的视频检测器插件在页面上有多个实例时复制内容
- 动态添加内容样式到 CKEditor 4 实例
- 如何将@media打印样式应用于 ckeditor 实例
- 如何将“拖动启动”事件与 CKEditor 实例分离
- Ckeditor 实例就绪未在 chrome 中触发(仅限某些系统)
- 如何使用jQuery将TypeKit字体加载到CKEditor实例中
- 在Ckeditor实例中通过htmlbutton插件插入文本之前重新定位插入符号
- 更改CKEditor实例的配置选项
- 在单个页面上处理多个Ckeditor实例
- 在Vue.js中使用CKeditor实例
- CKEditor +量角器:用量角器测试不能找到CKEditor实例