.fck编辑器插入图片去掉默认的width和height属性的有效方法
发布:smiling 来源: PHP粉丝网 添加日期:2015-03-24 13:44:25 浏览: 评论:0
.fck编辑器插入图片去掉默认的width和height属性的处理方法,打开文件 fckeditor/editor/dialog/fck_image/fck_images.js找到对应的代码段即可处理了.
打开文件 fckeditor/editor/dialog/fck_image/fck_images.js,注释以下代码即可,代码如下:
- if ( oImage.style.width )
 - {
 - var aMatchW = oImage.style.width.match( regexSize ) ;
 - if ( aMatchW )
 - {
 - iWidth = aMatchW[1] ;
 - oImage.style.width = '' ;
 - SetAttribute( oImage, 'width' , iWidth ) ;
 - }
 - }
 - if ( oImage.style.height )
 - {
 - var aMatchH = oImage.style.height.match( regexSize ) ;
 - if ( aMatchH )
 - {
 - iHeight = aMatchH[1] ;
 - oImage.style.height = '' ;
 - SetAttribute( oImage, 'height', iHeight ) ;
 - }
 - }
 - GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ;
 - GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ;
 - ----------
 - SetAttribute( e, "width" , GetE('txtWidth').value ) ;
 - SetAttribute( e, "height", GetE('txtHeight').value ) ;
 - ----------
 - if ( bLockRatio )
 - {
 - if ( GetE('txtWidth').value.length > 0 )
 - OnSizeChanged( 'Width', GetE('txtWidth').value ) ;
 - else
 - OnSizeChanged( 'Height', GetE('txtHeight').value ) ;
 - }
 - ----------
 - var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ;
 - ----------
 - if ( dimension == 'Width' )
 - value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ;
 - else //开源软件:phpfensi.com
 - value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ;
 - ----------
 - GetE('txtWidth').value = oImageOriginal.width ;
 - GetE('txtHeight').value = oImageOriginal.height ;
 - ----------
 - GetE('txtWidth').value = width ? width : '' ;
 - GetE('txtHeight').value = height ? height : '' ;
 
Tags: fck编辑器 图片属性
相关文章
- ·dedecms漏洞防护(2013-11-15)
 - ·DedeCMS Error: (PHP 5.3 and above) Please set request_or (2013-11-15)
 - ·DEDE5.7 去掉漏洞的直接的方法(2013-11-15)
 - ·dedecms文章内容页中的收藏功能收藏的文章路径错误问题解决(2013-11-15)
 - ·给织梦DedeCMS文章标题增加自动加长尾关键词的方法(2013-11-15)
 - ·dedecms列表页上一页下一页翻页单独调用(2013-11-15)
 - ·dedecms php.ini register_globals must is Off(2013-11-28)
 - ·dedecms 问答系统如何取消积分与用户登陆验证(2013-11-28)
 - ·织梦cms利用weight排序无效的解决方法(2013-12-03)
 - ·dedecms上传图片文件时提示 Upload filetype not allow(2013-12-04)
 - ·DedeCMS图集中缩略图不能显示的解决方法(2014-01-09)
 - ·安装dedecms:Call to undefined function get_magic_quotes_gpc()(2014-01-09)
 - ·dede首页调用专题页描述和链接方法(2014-01-09)
 - ·Dedecms怎么在首页调用最新评论(2014-01-09)
 - ·dedecms自定义模型之独立模型在首页、列表页、内容调用内容(2014-03-11)
 - ·织梦DedeCMS子目录移动到根目录的方法(2014-03-11)
 
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
 - PHP新手上路(一)(7)
 - 惹恼程序员的十件事(5)
 - PHP邮件发送例子,已测试成功(5)
 - 致初学者:PHP比ASP优秀的七个理由(4)
 - PHP会被淘汰吗?(4)
 - PHP新手上路(四)(4)
 - 如何去学习PHP?(2)
 - 简单入门级php分页代码(2)
 - php中邮箱email 电话等格式的验证(2)
 
