jquery xheditor 很好用的编辑器

张映 发表于 2012-07-09

分类目录: nodejs/vue/js/jquery

标签:, ,

xheditor自身支持中文,中文繁体,英文。不用自己去改插件了。插件本身不算大,功能齐全。可以加编辑器背景图片,可以用ajax异步上传文件,整合了google map等。还不算太完善,例如:编辑器框设定大小后,不能修。

$(document).ready(function() {
    //调用插件
    $.extend(xheditor.settings,{shortcuts:{'ctrl+enter':submitForm}});
    $('#elm5').xheditor({tools:'Cut,Copy,Paste,Pastetext,Blocktag,Fontface,FontSize,Bold,Italic,Underline,FontColor,BackColor,SelectAll,Removeformat,Align,List,Outdent,Indent,Link,Unlink,Anchor,Hr,Source,Preview,Print,Fullscreen'});

    //拉申功能
    $("#button").bind("click",function(){
        height = $("table.xheLayout").css("height");
        f_height = $("#xhe0_iframearea").css("height");
        new_height = parseInt(height.substring(0,height.length-2))+50;
        h_iframe = parseInt(f_height.substring(0,f_height.length-2))+50;
        $("table.xheLayout").css("height",new_height+"px");
        $("#xhe0_iframearea").css("height",h_iframe+"px");
    });

    $("#button1").bind("click",function(){
        height = $("table.xheLayout").css("height");
        f_height = $("#xhe0_iframearea").css("height");
        new_height = parseInt(height.substring(0,height.length-2))-50;
        h_iframe = parseInt(f_height.substring(0,f_height.length-2))-50;
        $("table.xheLayout").css("height",new_height+"px");
        $("#xhe0_iframearea").css("height",h_iframe+"px");
    });
});

demo地址:http://blog.51yip.com/demo/xheditor/



转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/jsjquery/1428.html