首先去下载百度编辑器
引入百度编辑器
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script> <!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败--> <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文--> <script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>可以在这里设置高度及宽度
<script type="text/plain" id="myEditor" style="width:500px;height:500px"></script>实例化编辑器时,可以不在给定宽高
var ue= UE.getEditor('myEditor');也可以给定高度及宽度
var ue = UE.getEditor('myEditor',{ initialFrameWidth :800,//设置编辑器宽度 initialFrameHeight:250,//设置编辑器高度 scaleEnabled:true //scaleEnabled {Boolean} [默认值:false] //是否可以拉伸长高,默认true(当开启时,自动长高失效) });还有一种就是直接修改ueditor.config.js 注意:给定initialFrameWidth的优先级比给容器的style优先级要高。
相关资源:python入门教程(PDF版)