如何在全屏模式下启动TinyMCE 4?

时间:2014-04-08 14:02:13

标签: javascript tinymce wysiwyg tinymce-4 html-editor

有没有办法在全屏模式下启动TinyMCE 4?我刚从TinyMCE 3.x升级,但它在3.x中完成的方式似乎不适用于4.x:

<head>
<script type="text/javascript" src="TinyMCE/tinymce.min.js"></script>
<script type="text/javascript">
  tinyMCE.init({
    oninit : function() {
      tinyMCE.get('editor').execCommand('mceFullScreen');
    }
  });
</script>
</head>

<body>
  <textarea id="editor"></textarea>
</body>

有什么建议吗?

1 个答案:

答案 0 :(得分:18)

了解如何操作:

<head>
<script type="text/javascript" src="TinyMCE/tinymce.min.js"></script>
<script type="text/javascript">
  tinyMCE.init({
    plugins: [ 'fullscreen' ],
    setup: function(editor) {
      editor.on('init', function(e) {
        editor.execCommand('mceFullScreen');
      });
    }
  });
</script>
</head>

<body>
  <textarea id="editor"></textarea>
</body>