您的位置:首页 > 其它

KindEditor编辑器的使用

2016-01-26 00:43 351 查看
1.下载KindEditor编辑器 以KindEditor 4.1.10为例.

2.将下载解压完的KindEditor文件夹放在__ROOT__中.

3.在thinkphp中的Index/index.html中添加以下代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<load href="__ROOT__/kindeditor-4.1.10/kindeditor-min.js"/>    //加载kindeditor
<script>
KindEditor.ready(function(K) {
window.editor = K.create('.editor',{
width:'500px', //kindeditor样式
height:'300px',
//uploadJson :'__ROOT__/kindeditor-4.1.10/php/upload_json.php', //图片上传参数(1).
//fileManagerJson :'__ROOT__/kindeditor-4.1.10/php/file_manager_json.php', //图片上传参数(2).
allowFileManager : true,
resizeType:2, //2或1或0,2时可以拖动改变宽度和高度,1时只能改变高度,0时不能拖动。
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright'
] //功能图标
});
});
</script>
</head>
<body>
<div style="margin-left:50px">
      <textarea name="content" class="editor"></textarea>
    </div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: