标签: sceditor

jQuery插件:将mCustomScrollbar应用于SCEditor

如何将mCustomScrollbar应用于SCEditor?

这是我到目前为止所尝试的:

HTML

<button id="btnScrollBar">Apply scrollbar</button>
<textarea id="editor"></textarea>
Run Code Online (Sandbox Code Playgroud)

JS

$("#editor").sceditor({
    plugins: "xhtml",
    width: '100%',
    style: "http://www.sceditor.com/minified/jquery.sceditor.default.min.css"
});

$("#btnScrollBar").click(function()
{
    console.log("click");
    $(".sceditor-container iframe").contents().find("body").mCustomScrollbar();
});
Run Code Online (Sandbox Code Playgroud)

我也尝试了另一种方法,遵循这个例子,但是导致身体被删除(参见这个问题)

jquery jquery-plugins sceditor mcustomscrollbar

7
推荐指数
1
解决办法
331
查看次数

从 SCEditor 获取值

我正在尝试使用以下代码从 SCEditor 文本区域获取值:

var fbeschreibung = '';
$(function() {
    // Replace all textarea's
    // with SCEditor
    $("textarea").sceditor({
        plugins: "bbcode",
        style: "css/style.less",
        width: "100%",
        toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|size,color,removeformat|bulletlist,orderedlist,horizontalrule,emoticon",
        locale:"de" ,
        resizeEnabled:false
    });
    fbeschreibung = $('textarea').sceditor('instance').val();
    $('textarea').sceditor('instance').val('Hello [b]World![/b]');
});
Run Code Online (Sandbox Code Playgroud)

然后我想通过 AJAX 发送该值:

$.post('saveprofile.php', 
   {fbeschreibung : fbeschreibung},
   function (response) {
      alert(response);
   }
);
Run Code Online (Sandbox Code Playgroud)

但是,我无法让它发挥作用。我在文档中没有找到任何提示:http://www.sceditor.com/api/sceditor/val/

我的变量fbeschreibung只是空的。我是不是做错了什么?

javascript ajax jquery sceditor

2
推荐指数
1
解决办法
2687
查看次数