resize CKEditor4 by windows.resize events

无人久伴 提交于 2019-12-25 02:26:04

问题


I not need the "user ability to resize", but an automatic resize triggered by windows.resize events.

Translating my necessity into an hipothetical/intentional code (it not works!), for my applicartion:

    $( window ).resize(function() {
        editor = CKEDITOR.instances.editor1;
        editor.height = window.innerHeight - 106;
        editor.width  = window.innerWidth  - 253;
    });

How to implement this kind of resize with CKEditor4? I am using standard editor at textarea.


PS: the name of the behaviour is perhaps "Change the Size of the Editor on the Fly", but my necessity is not about config by percentual width, see the required subtractions.


回答1:


Well... just use the editor.resize() method ;)

$( window ).resize(function() {
    editor = CKEDITOR.instances.editor1;
    editor.resize( window.innerWidth  - 253, window.innerHeight - 106 );
});


来源:https://stackoverflow.com/questions/22999345/resize-ckeditor4-by-windows-resize-events

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!