ueditor.all.js中:直接搜索callback()
 function callback(){
try{
var link, json, loader,
body = (iframe.contentDocument || iframe.contentWindow.document).body,
result = body.innerText || body.textContent || '';
json = (new Function("return " + result))();
link = me.options.imageUrlPrefix + json.url;
if(json.state == 'SUCCESS' && json.url) {
loader = me.document.getElementById(loadingId);
loader.setAttribute('src', link);
loader.setAttribute('_src', link); /*==================自己添加的代码====================*/
var width='';
var height='';
// 创建对象
var img = new Image();
// 设置图片的src
img.src = link;
//console.log("link:"+link);
img.onload = function(){
console.log('width:'+img.width+',height:'+img.height);
width=img.width;
height=img.height;
loader.setAttribute('width',width);
loader.setAttribute('height',height);
};
/*===================结束========================*/ loader.setAttribute('title', json.title || '');
loader.setAttribute('alt', json.original || '');
loader.removeAttribute('id');
domUtils.removeClasses(loader, 'loadingclass');
} else {
showErrorLoader && showErrorLoader(json.state);
}
}catch(er){
showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError'));
}
form.reset();
domUtils.un(iframe, 'load', callback);
}

或者自己设定大小

 /*==================自己添加的代码====================*/
var width='';
var height='';
// 创建对象
var img = new Image();
// 设置图片的src
img.src = link;
//console.log("link:"+link);
img.onload = function(){
console.log('width:'+img.width+',height:'+img.height);
width=img.width;
height=img.height;
loader.setAttribute('width','340px');
// loader.setAttribute('height',height);
};
/*===================结束========================*/

或者

loader.setAttribute('width','100%');

前端显示也100%
												

百度富文本编辑器Ueditor上传图片时标签中添加宽高的更多相关文章

  1. 百度富文本编辑器UEditor安装配置全过程

    网站开发时富文本编辑器是必不可少的,他可以让用户自行编辑内容的样式然后上传到后台!下面我们来介绍如何安装使用百度富文本编辑器 一.下载并且设置百度富文本编辑器的样式     你可以去百度UEditor ...

  2. 百度富文本编辑器ueditor使用总结

    最近做的项目用到了ueditor这个东东,但是他的一些配置文档对初次使用者来说很难以理解,故作此总结 相关详细操作链接地址: http://blog.csdn.net/wusuopubupt/arti ...

  3. 百度富文本编辑器ueditor使用启示

    百度富文本编辑器ueditor使用启示 一.总结 一句话总结:使用工具,多去看官方demo,非常详细. 二.百度富文本编辑器ueditor使用启示 官方完整demo 官方完整demo对应的源代码 &l ...

  4. springboot+layui 整合百度富文本编辑器ueditor入门使用教程(踩过的坑)

    springboot+layui 整合百度富文本编辑器ueditor入门使用教程(踩过的坑) 写在前面: ​ 富文本编辑器,Multi-function Text Editor, 简称 MTE, 是一 ...

  5. thinkphp5.1中适配百度富文本编辑器ueditor

    百度富文本编辑器ueditor虽然很老,但是功能齐全,我近期需要能批量粘贴图片的功能,但是找不到,很无奈.然后现在就分享一下如何把ueditor适配到thinkphp5.1,有知道如何批量上传图片的艾 ...

  6. 百度富文本编辑器ueditor在jsp中的使用(ssm框架中的应用)

    折腾了一下午终于把百度富文本编辑器ueditor搞定了!   项目地址:https://github.com/724888/lightnote_new     首先我参考了一个ueditor的demo ...

  7. Html引入百度富文本编辑器ueditor

    在日常工作用,肯定有用到富文本编辑器的时候,富文本编辑器功能强大使用方便,我用的是百度富文本编辑器,首先需要下载好百度编辑器的demo, 然后创建ueditor.html文件,引入百度编辑器,然后在h ...

  8. Html引入百度富文本编辑器ueditor及自定义工具栏

    在日常工作用,肯定有用到富文本编辑器的时候,富文本编辑器功能强大使用方便,我用的是百度富文本编辑器,首先需要下载好百度编辑器的demo, 然后创建ueditor.html文件,引入百度编辑器,然后在h ...

  9. Jfinal整合百度富文本编辑器ueditor

    ueditor配置文件ueditor.config.js修改参数serverUrl:(改为要调用的action) 后台代码 package com.sandu.mega.admin.ueditor; ...

随机推荐

  1. 网络上面好用的webserice方法【公开】

    原文发布时间为:2009-07-27 -- 来源于本人的百度文章 [由搬家工具导入] 本帖转自 http://www.webxml.com.cn/zh_cn/web_services.aspx?off ...

  2. [LeetCode] Minimum Depth of Binary Tree 二叉树最小深度

    Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shor ...

  3. Glide图片加载回调

    1.方法一:设置图片中监听 使用的是SimpleTarget类,他继承自BaseTarget,需要重写onResourceReady方法,onResourceReady方法表示加载完成后的回调,下面列 ...

  4. CS Academy Round #65 Count Arrays (DP)

    题目链接  Count Arrays 题意  给定$n$和$m$个区间.若一个长度为$n$的$01$序列满足对于每一个给定的区间中至少有一个位置是$0$, 那么这个$01$序列满足条件.求有多少满足条 ...

  5. linux挂载新磁盘、分区和开机自动挂载

    今天在阿里云虚拟主机里新加了一块磁盘,需要单独挂载到centos7. 挂载过程中遇到了不少问题,记录如下: 查看分区 fdisk -l 其中第一个框和第二个框,是已经分好区的磁盘,第三个硬盘没有分区. ...

  6. 用pid 取主窗口 hwnd

    HWND GetHwndByPid(DWORD dwProcessID) { HWND h = GetTopWindow(); HWND retHwnd = NULL; while ( h ) { D ...

  7. Spring MVC的各种参数绑定方式(请求参数用基础类型和包装类型的区别)(转)

    1.基本数据类型(以int为例,其他类似): Controller代码: @RequestMapping("saysth.do") public void test(int cou ...

  8. asp.net获取请求的协议头是否启动了SSL(Https)

    方法: HttpContext.Current.Request.IsSecureConnection SLL:True HttpContext.Current.Request.Url.ToString ...

  9. ORACLE普通表转换成分区表

    转http://mp.weixin.qq.com/s?__biz=MzAwMjkyMjEwNg==&mid=2247484761&idx=1&sn=ce080581145931 ...

  10. pt-query-digest 实践(转)

    mysql slowlog 使用与介绍 slow_query_log =1-----是否打开 slow_query_log_file = /data/mysql_data/node-1/mysql-s ...