TinyMCE的文本对齐按钮不在线上编辑工作(Tinymce align text buttons

2019-10-31 04:47发布

我有以下代码:

HTML:

<p id="edit">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

JS:

<script type="text/javascript">

    $(document).ready(function(){
        tinymce.init({ 
        inline : true,
        selector : 'p#edit'
        });
    });
</script>

这是如何在工具栏中的样子:

文本对齐按钮和符号列表按钮,也缩进按钮不工作

发生了什么事错在这里?

Answer 1:

我没有试图使AP元素作为一个编辑器,但这里是我的代码有一个文本。 关键是,你使用正确的选择和正确的模式。

HTML:

<div class="form-group">
    <div class="col-sm-12">
        @Html.TextAreaFor(m => m.MarketingInformation, new { @class = "form-control mceEditor" })
    </div>
</div>

JS:

<script type="text/javascript">
        tinymce.init({
            mode: "specific_textareas",
            editor_selector : "mceEditor",
            height: 100,
            plugins: [
                "advlist autolink lists link charmap print preview anchor textcolor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime table contextmenu paste textcolor"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor"
        });

</script>

我认为,如果你使用的模式为“精确”它应该工作,但我还没有尝试过; http://www.tinymce.com/wiki.php/Configuration3x:mode



文章来源: Tinymce align text buttons don't work on inline editing