两个jquery插件到同一个textarea

时间:2015-11-02 10:59:33

标签: javascript jquery jquery-plugins

我有一个文本区域。我正在使用texteditor插件将文本区域转换为文本编辑器。我将相同的textarea连接到另一个插件,其他一些工作。但是第二个插件不能以这种方式工作。我删除了texteditor插件,然后第二个插件工作正常。我无法理解这个问题。

我的代码:以下js连接id =" ha"的文本区域。用htmlbox pugin。

$(document).ready(function() {

$("#ha").css("height","100%").css("width","100%").htmlbox({
toolbars:[
    [
    // Cut, Copy, Paste
    "separator","cut","copy","paste",
    // Undo, Redo
    "separator","undo","redo",
    // Bold, Italic, Underline, Strikethrough, Sup, Sub
    "separator","bold","italic","underline","strike","sup","sub",
    // Left, Right, Center, Justify
    "separator","justify","left","center","right",
    // Ordered List, Unordered List, Indent, Outdent
    "separator","ol","ul","indent","outdent",
    // Hyperlink, Remove Hyperlink, Image
    "separator","link","unlink","image"

    ],
    [// Show code
    "separator","code",
    // Formats, Font size, Font family, Font color, Font, Background
    "separator","formats","fontsize","fontfamily",
    "separator","fontcolor","highlight",
    ],
    [
    //Strip tags
    "separator","removeformat","striptags","hr","paragraph",
    // Styles, Source code syntax buttons
    "separator","quote","styles","syntax"
    ]
],
skin:"blue"
    });


});

以下js将我的另一个插件连接到同一个textarea" ha"

$(document).ready(function() {


var language="hindi";

 $('#ha').myPlugin({

   language : language,
   rApi :"xxxxxxxxxxxx",
   rAppId:"xxxxxxx",

 });

});

如果我没有将textarea连接到第一个插件,那么第二个插件可以正常工作,但是如果有两个插件与textarea连接" ha"然后只有第一个工作。

0 个答案:

没有答案