3

我已经下载了 TinyMCE V4.0.1 并且真的很想使用它。不幸的是,当我使用它时,发生了一些不应该发生的事情:

  • 在具有下拉菜单的按钮(如颜色按钮)上,下拉菜单位于按钮下方
  • When selecting a piece of text and for example pressing the B button to make it bold, the cursor jumps back to the start of the editor and nothing happens.

这是我用于编辑器的代码:

tinymce.init({
    selector: "#fulltext_editor",
    theme: "modern",
    plugins: [
        "advlist autolink lists link image charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars code fullscreen",
        "insertdatetime media nonbreaking save table contextmenu directionality",
        "emoticons template paste textcolor"
    ],
    menubar: false,
    toolbar1: "save | insertfile undo redo | styleselect | bold italic underline subscript superscript | alignleft aligncenter alignright alignjustify",
    toolbar2: "bullist numlist | forecolor backcolor | link image media | table | searchreplace | code"
});

即使使用更简单的代码,上述几点也会发生。我还没有找到任何解释为什么会发生这种情况以及如何解决这个问题。另外,我根本无法使用 jQuery 版本(我在我的网站上使用 jQuery 来处理其他内容)

4

1 回答 1

0

For the problem with the dropdowns, you have probably set the HTML span element to display: block somewhere in your CSS. Add the following to fix it:

.mce-menubtn span {
  display: inline-block
}

In terms of the bold functionality not working, I can only imagine there is a JS conflict somewhere. Is anything showing up in the JS Console when you load the page or click the button?

于 2014-05-20T15:58:12.553 回答