如何使内联ckeditor工具栏固定在顶部,而不是浮动 [英] How to make the inline ckeditor toolbar fixed at the top and not float
问题描述
我在我的页面中使用内联CKEditor。我想把它固定在contenteditable div的顶部。目前,当我滚动页面时,它是浮动的。如何使工具栏位置固定在顶部?
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?
推荐答案
使用内联编辑器和共享空间插件。使用CKEditor SDK页面查看共享工具栏和底栏的内联编辑器演示示例。请注意,您可以查看和下载每个SDK示例的源代码 - 只需向下滚动到获取示例源代码并抓取您需要的。
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>
这篇关于如何使内联ckeditor工具栏固定在顶部,而不是浮动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!