1.初始化layer和kindeditor
layui.use(['layer'], function () {
window.layer = layui.layer;
KindEditor.ready(function (K) {
window.K=K;
mounted();
});
});
2.打开弹框显示kindeditor
function mounted() {
$('#btn_open').click(function () {
layer.open({
title: '编辑',
type: 1,
content: ‘<textarea id="editor_id" name="content" style="width: 90%;height: 300px;"></textarea>’,
area: ['70%', '70%'],
btn:['确定','取消'],
success :function(){
window.editor = K.create('#editor_id');
},
yes:function (index, layero) {
},
btn2:function (index,layero) {
}
});
})
}
3.解决kindeditor弹框显示在layer下方问题
修改kindeditor.js中的811213全部替换为19892000,
811212替换为19891999,
811214替换为19892001,
811211替换为19891998