KindEditor 一頁中顯示多個編輯器


因為網站中使用了 jQuery 所以可以方便解決掉

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script type="text/javascript" charset="utf-8" src="/static/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// 動應生成編輯器的 ID ,以解決 KindEditor 只認獨立 ID 的問題
$("textarea.editor").each(function(index) {
$(this).attr("id", "editor_" + index);
KE.show({
id: "editor_" + index,
allowUpload: false,
height: "200px",
resizeMode: 1 // 只可以調整高度
});
});
});
</script>