1.编辑器自适应页面
在实例化编辑器时加上
initialFrameWidth:'100%',//初始化编辑器宽度
代码
<!-- 加载编辑器的容器 -->
<script id="editor" type="text/plain"></script>
<%--<textarea name="editor" id="editor"></textarea>--%>
<script>
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('editor',{
zIndex : 0,
initialFrameWidth:'100%',//初始化编辑器宽度
initialFrameHeight:750,//初始化编辑器高度
autoHeightEnabled:false,//是否自动长高,默认true
maximumWords:5000000, //允许的最大字符数
topOffset:69, //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
});
2.图片上传宽高自适应
在Ueditor\themes\iframe.css 加入以下代码(原先的css文件应该是空的,只有一行注释)
/*可以在这里添加你自己的css*/
img {
max-width: 100%; /*图片自适应宽度*/
}
body {
overflow-y: scroll !important;
}
.view {
word-break: break-all;
}
.vote_area {
display: block;
}
.vote_iframe {
background-color: transparent;
border: 0 none;
height: 100%;
}
#edui1_imagescale{display:none !important;} /*去除点击图片后出现的拉伸边框*/
2.修改Ueditor\ueditor.config.js下面的一句,去掉前面的注释//给编辑器内部引入iframe.css文件。
//,iframeCssUrl: URL + '/themes/iframe.css'</