Layui弹窗不兼容KindEditor的解决办法
浏览量:400
使用了Layui中layer.open的弹窗时,KindEditor无法显示,即使显示了,鼠标也点不进去。
原因是Layui在layer.open时重新渲染了一遍dom元素,导致KindEditor无法跟着一起渲染。
解决办法:open后再渲染一遍KindEditor就好了
layer.open({ type: 1, title: 我是可爱的标题, area: [700px,500px], content: $(#id), //弹出DIV的id success :function(){ //弹窗后加载KindEditor var editor = KindEditor.create(#mp_detailContent,{ width : "100", height: "300px", afterBlur: function(){ this.sync(); } //重新获取焦点 }); } ,end: function(){ //弹窗后销毁富文本,不然再次弹出后依然不好使 KindEditor.remove(#mp_detailContent); } });