JAVA、PHP、前端、APP、网站开发 - 开发技术学习

开发技术学习 » 前端设计 » kindeditor编辑器语言设置与页面多个编辑器设置

kindeditor编辑器语言设置与页面多个编辑器设置

此文被围观4747日期: 2013-07-16 分类 : 前端设计  标签:  ······
首先看一下官方提出的方法: 移除编辑器后重新创建就可以,这是修改页面编辑器, http://www.kindsoft.net/ke4/examples/multi-language.html 查看页面源码: [html] <script> var editor; KindEditor.ready(function(K) { K('select[name=lang]').change(function() { if (editor) { editor.remove(); editor = null; } editor = K.create('textarea[name="content"]', { langType : this.value }); }); K('select[name=lang]').change(); }); </script> [/html] 分析主要是利用langType来完成 那么我们初始加载的时候就直接加一下langType的属性就好了! 再看一下一个页面多个编辑器: [js] var editor;editor2; editor = K.create('textarea[id="reviews"]', { resizeType : 1, allowPreviewEmoticons : false, imageUploadJson : '/Public/Js/kindeditor/php/upload_json.php', fileManagerJson : '/Public/Js/kindeditor/php/file_manager_json.php', allowImageUpload : true, items : [ 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'], langType : 'en' }); editor2 = K.create('textarea[id="reviews"]', { resizeType : 1, allowPreviewEmoticons : false, imageUploadJson : '/Public/Js/kindeditor/php/upload_json.php', fileManagerJson : '/Public/Js/kindeditor/php/file_manager_json.php', allowImageUpload : true, items : [ 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'], langType : 'en' }); [/js] 就这么简单,反正我是用的这个方法,目前还没有发现错误!

站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号