如何为每个添加不同配置的多个TinyMCE编辑器? [英] How I can add multi TinyMCE editors with different config for each one?

查看:431
本文介绍了如何为每个添加不同配置的多个TinyMCE编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加多个TinyMCE编辑器,每个编辑器在一个页面中都有自己的配置?

I want to add multi TinyMCE editors and each one has its own configuration in one page?

我怎么做?

推荐答案

您可以这样做:

jQuery版本:

$('textarea.editor1').tinymce(
{
    script_url : '../admin/tiny_mce/tiny_mce.js',
    theme : "simple",
    plugins : "", // put plugins here
    setup : function(ed) 
    {
         ed.onInit.add(function(ed)
        {

        });             
    }
});

$('textarea.editor2').tinymce(
{
    script_url : '../admin/tiny_mce/tiny_mce.js',
    theme : "simple",
    plugins : "", // put plugins here
    setup : function(ed) 
    {
         ed.onInit.add(function(ed)
        {

        });             
    }
});

非jQuery版本:

tinyMCE.init(
{
    mode : "textareas",
    theme : "simple",
    editor_selector : "editor1"
});

tinyMCE.init(
   {
       mode : "textareas",
    theme : "simple",
    editor_selector : "editor2"

   });

这篇关于如何为每个添加不同配置的多个TinyMCE编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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