如何使内联ckeditor工具栏固定在顶部,而不是浮动 [英] How to make the inline ckeditor toolbar fixed at the top and not float

查看:1565
本文介绍了如何使内联ckeditor工具栏固定在顶部,而不是浮动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的页面中使用内联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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆