用户提问
①:引入jquery.js; ②:引入KindEditor.js; ③:引入KindEditor对应的css; ④:给Html中的文本域赋予一个id;如: ⑤:在js中调用,如: var editor1; KindEditor.ready(function(K){ editor1 = K.create("#product",{ width: "80%", //...
推荐答案
①:引入jquery.js;
②:引入KindEditor.js;
③:引入KindEditor对应的css;
④:给Html中的文本域赋予一个id;如:
⑤:在js中调用,如:
var editor1;
KindEditor.ready(function(K){
editor1 = K.create("#product",{
width: "80%", //设置文本域的宽度
height: '151px', //设置文本域的高度
//设置文本域的显示主题风格(需要根据引入的kingEditor主题而定)
themeType : 'simple',
syncType: 'form', //同步表单
resizeType: 0, //禁止用户拖动文本域
afterBlur: function(){this.sync();} //将kindeditor的值同步到textarea
});
这是基本的,其他属性可以查看KindEditor的API教程,有详细介绍
辅助答案
用户:tongxin009
2018年08月09日
①:引入jquery.js;
②:引入KindEditor.js;
③:引入KindEditor对应的css;
④:给Html中的文本域赋予一个id;如:
⑤:在js中调用,如:
var editor1;
KindEditor.ready(function(K){
editor1 = K.create("#product",{
width: "80%", //设置文本域的宽度
height: '151px', //设置文本域的高度
//设置文本域的显示主题风格(需要根据引入的kingEditor主题而定)
themeType : 'simple',
syncType: 'form', //同步表单
resizeType: 0, //禁止用户拖动文本域
afterBlur: function(){this.sync();}//将kindeditor的值同步到textarea
});
这是基本的,其他属性可以查看KindEditor的API教程,有详细介绍