TinyMCE fixed_toolbar_container configuration

徘徊边缘 提交于 2019-12-23 19:36:52

问题


I tried using fixed_toolbar_container configuration inside tinymce.init, but it left me with plain html textarea instead of rich text editor. Here's my code:

<html>
<head>
    <script src="tinymce\js\tinymce\tinymce.min.js"></script>
    <script type="text/javascript">
        tinymce.init({
            selector: "textarea",
            inline: true,
            fixed_toolbar_container: "#mytoolbar",

            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
        });
    </script>
</head>
<form method="post" action="somepage">
    <div id="mytoolbar" style="width:800; height:80; border : 1px blue solid"></div></BR>
    <textarea id="content"></textarea>
</form>
</html>

I'm using latest, 4.0.1, version of TinyMCE.

Could someone please tell me how should I disintegrate TinyMCE toolbar (which is attached to the top of the textarea) into a separate DIV/iFrame?

I'll appreciate a working sample code.

Thanks in advance!


回答1:


You use the selector textarea and also inline: true at the same time, which is conflicting. Either remove the inline setting, or change the selector to some DIV classname or ID that you want editable.



来源:https://stackoverflow.com/questions/17353412/tinymce-fixed-toolbar-container-configuration

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