织梦ckeditor编辑器 通过修改js去除img标签内的width和height样式

1. 文件\include\ckeditor\plugins\image\dialogs\image.js

2. 使用工具美化js代码

3. 搜索 setStyle('width', CKEDITOR.tools.cssLength

找到下面设置width的代码并注释掉

if (C == d) {
    if (F) D.setStyle('width', CKEDITOR.tools.cssLength(F));
    else D.removeStyle('width');
    !E && D.removeAttribute('width');
} else if (C == f) {
    var G = F.match(h);
    if (!G) {
        var H = this.getDialog().originalElement;
        if (H.getCustomData('isReady') == 'true') D.setStyle('width', H.$.width + 'px');
    } else D.setStyle('width', CKEDITOR.tools.cssLength(F));
} else if (C == g) {
    D.removeAttribute('width');
    D.removeStyle('width');
}

4. 搜索 setStyle('height', CKEDITOR.tools.cssLength

找到下面设置height的代码并注释掉

if (C == d) {
    if (F) D.setStyle('height', CKEDITOR.tools.cssLength(F));
    else D.removeStyle('height');
    !E && D.removeAttribute('height');
} else if (C == f) {
    var G = F.match(h);
    if (!G) {
        var H = this.getDialog().originalElement;
        if (H.getCustomData('isReady') == 'true') D.setStyle('height', H.$.height + 'px');
    } else D.setStyle('height', CKEDITOR.tools.cssLength(F));
} else if (C == g) {
    D.removeAttribute('height');
    D.removeStyle('height');
}

 

转载于:https://www.cnblogs.com/bubuchu/p/8522420.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值