没改动之前是上面这样的,图片显示不开,撑出了滚动条,想让他自适应100%,不出现滚动条

网上有方法

1.ueditor 的 themes 文件夹下有个iframe.css 加入以下代码,保存(原先的css文件应该是空的,只有一行注释)/// 个人感觉没用,调试了一下确实没用不知为什么,放在这了

  1. img {  
  2.  max-width: 100%; /*图片自适应宽度*/  
  3. }  
  4. body {  
  5.  overflow-y: scroll !important;  
  6. }  
  7. .view {  
  8.  word-break: break-all;  
  9. }  
  10. .vote_area {  
  11.  display: block;  
  12. }  
  13. .vote_iframe {  
  14.  background-color: transparent;  
  15.  border: 0 none;  
  16.  height: 100%;  
  17. }  
  18. #edui1_imagescale{display:none !important;} 

前台引入css

  1. <script type="text/javascript">
  2. var ue = UE.getEditor('container', {
  3. toolbars: [
  4. ['fullscreen','source','undo','redo','indent','bold','italic','underline','fontborder','snapscreen','print','preview','link','unlink','insertrow','insertcol','mergeright','mergedown','deleterow','deletecol','splittorows','splittocols','splittocells','fontfamily','fontsize','simpleupload','insertimage','spechars','searchreplace','justifyleft','justifyright','justifycenter'],
  5. ['justifyjustify','forecolor','backcolor','attachment','imagecenter','wordimage','inserttable','strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
  6. ],
  7. iframeCssUrl: '__PUBLIC__/other/ueditor/themes/iframe.css',// 引入css
  8. autoHeightEnabled: true,
  9. autoFloatEnabled: true
  10. });
  11. </script>

2.ueditor.all.js 找到render:function(container){}修改如下:、// 亲测好用

  1. var html = ( ie && browser.version < 9 ? '' : '<!DOCTYPE html>') +
  2. '<html xmlns=\'http://www.w3.org/1999/xhtml\' class=\'view\' ><head>' +
  3. '<style type=\'text/css\'>' +
  4. //设置四周的留边
  5. '.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\n' +
  6. //设置默认字体和字号
  7. //font-family不能呢随便改,在safari下fillchar会有解析问题
  8. 'body{margin:8px;font-family:sans-serif;font-size:16px;}' +
  9. //设置图片最大宽度,以免撑出滚动条
  10. 'img{max-width:100%;}'+
  11. //设置段落间距
  12. 'p{margin:5px 0;}</style>' +
  13. ( options.iframeCssUrl ? '<link rel=\'stylesheet\' type=\'text/css\' href=\'' + utils.unhtml(options.iframeCssUrl) + '\'/>' : '' ) +
  14. (options.initialStyle ? '<style>' + options.initialStyle + '</style>' : '') +
  15. '</head><body class=\'view\' ></body>' +
  16. '<script type=\'text/javascript\' ' + (ie ? 'defer=\'defer\'' : '' ) +' id=\'_initialScript\'>' +
  17. 'setTimeout(function(){editor = window.parent.UE.instants[\'ueditorInstant' + me.uid + '\'];editor._setup(document);},0);' +
  18. 'var _tmpScript = document.getElementById(\'_initialScript\');_tmpScript.parentNode.removeChild(_tmpScript);</script></html>';

其实就加了一句

经实验,还是第二种好用

ueditor 上传的图片在内容里显示的尺寸过大的问题的更多相关文章

  1. magento 1.9 上传后图片前后台无法正常显示

    1.上传后图片不显示,设置 允许 flash 2.保证php 执行是内存大小至少为为128M,多种方式设置,这里以init_set为例子,在index.php 加入下面一行代码,根据情况而定 ini_ ...

  2. PHP之ThinkPHP框架(验证码、文件上传、图片处理)

     验证码 验证码是框架自带有的,比之前使用GD库简单方便许多,其实现原理基本相似,都是生成图片,保存验证码值到Session中,表单提交验证码,然后进行值的对比验证. 简单的显示: <form ...

  3. thinkphp 3.2.3整合ueditor 1.4,给上传的图片加水印

    今天分享一下thinkphp 3.2.3整合ueditor 1.4,给上传的图片加水印.博主是新手,在这里卡住了很久(>_<) thinkphp 3.2.3整合ueditor 1.4 下载 ...

  4. ajax 提交所有表单内容及上传图片(文件),以及单独上传某个图片(文件)

    我以演示上传图片为例子: java代码如下(前端童鞋可以直接跳过看下面的html及js): package com.vatuu.web.action; import java.io.File; imp ...

  5. UEditor上传自定义文件夹

    需求:使用UEditor上传时需要知道具体到哪个章节得图片,所以得根据Session中得文件重新定义 修改Handler类: public HttpSessionState Session {get; ...

  6. ASP.NET、JAVA跨服务器远程上传文件(图片)的相关解决方案整合

    一.图片提交例: A端--提交图片 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string u ...

  7. 为什么上传文件的表单里要加个属性enctype

    为什么上传文件的表单里要加个属性enctype 上传文件的表单中<form>要加属性enctype="multipart/form-data",很多人只是死记硬背知道上 ...

  8. 基于spring-boot的web应用,ckeditor上传文件图片文件

    说来惭愧,这个应用调试,折腾了我一整天,google了很多帖子,才算整明白,今天在这里做个记录和分享吧,也作为自己后续的参考! 第一步,ckeditor(本博文论及的ckeditor版本4.5.6)的 ...

  9. ckeditor 4.2.1_演示 ckeditor 上传&插入图片

    本文内容 FineUI ckeditor fckeditor/ckeditor 演示 ckeditor 4.2.1 上传&插入图片 最近看了一下 FineUI_v3.3.1 控件,对里边的 c ...

随机推荐

  1. nginx url重定向

    nginx内部支持url rewrite,内部编译进去了rewrite模块,nginx的rewrite模块类似于apache的rewriterule功能:支持多种规则和正则表达式: 详细介绍如下: N ...

  2. Android Context上下文解析

    1.Context概念 Context,相信不管是第一天开发Android,还是开发Android的各种老鸟,对于Context的使用一定不陌生~~你在加载资源.启动一个新的Activity.获取系统 ...

  3. web开发中常用的技术体系

    HTML html(HyperText  Markup  Language)超文本标记语言"超文本"就是指页面内可以包含图片.链接.程序等非文字元素. 超文本标记语言的结构包括&q ...

  4. 在VBA中新建工作簿

    用程序计算数据,得到不同公司.不同项目的数据结果,最终还要将每个公司的数据结果放在各自的单独文件中.这就需要在vba中新建.保存excel文件.掌握几个东西就能很熟练了:1.要想保存在当前目录下,需要 ...

  5. python获取指定时间段内的随机不重复的时间点

    上篇 <python时间时分秒与秒数的互相转换>http://www.cnblogs.com/gayhub/p/6154707.html 提到了把时间转成秒数的方法, 这篇写写转换成秒数后 ...

  6. HTML的 <u> 标签

    实例 使用 <u> 标签为文本添加下划线: <p>如果文本不是超链接,就不要<u>对其使用下划线</u>.</p> 亲自试一试 浏览器支持 ...

  7. lightoj1348

    //Accepted 6004 KB 924 ms /* source: lightoj1348 time :2015.5.29 by :songt */ /*题解: 树链剖分 */ #include ...

  8. Spring中的SPEL

    src\dayday\Person.java package dayday;/** * Created by I am master on 2016/11/28. */public class Per ...

  9. 一些初级Java错误,不定期增加

    1. Error: Dangling meta character '*' near index 0 对字符串使用split()方法截取 * ? + / | 等字符的时候会报以下异常 Dangling ...

  10. NPOI 单元格(cell) 格式参数

    NPOI 单元格(cell) 将格式设为文本 在网上找了很久,都没有关于如何设置的信息,没办法查了下NPOI的源码终于找到了方法.这里共享下,就是“@”参数 ICellStyle cellStyle ...