How to make the inline ckeditor toolbar fixed at the top and not float

醉酒当歌 提交于 2019-12-05 20:32:59

问题


I am using inline CKEditor in my page. I want to make it fixed on the top of the contenteditable div. Currently it is floating whenever i scroll the page. How to make the toolbar position fixed at the top?


回答1:


Use the combination of inline editor and the Shared Space plugin. Check the Inline Editor with Shared Toolbar and Bottom Bar demo on the CKEditor SDK page for an example. Note that you can view and download the source code of each SDK example - just scroll down to "Get Sample Source Code" and grab what you need.

<div id="toolbarLocation></div>
<div id="editor" contenteditable="true"></div>

<script>

    CKEDITOR.disableAutoInline = true;
    CKEDITOR.replace( 'editor', { 
        sharedSpaces: { 
            top: 'toolbarLocation' 
        } 
    } );

</script>


来源:https://stackoverflow.com/questions/22028087/how-to-make-the-inline-ckeditor-toolbar-fixed-at-the-top-and-not-float

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