html中a可以插入图片吗,关于kindeditor 插入图片时加入A标签问题!

本已经找到了代码 :

insertimage : function(url, title, width, height, border, align) {

title = _undef(title, '');

border = _undef(border, 0);

var html = ''%20+%20_escape(url)%20+%20'

if (width) {

html += 'width="' + _escape(width) + '" ';

}

if (height) {

html += 'height="' + _escape(height) + '" ';

}

if (title) {

html += 'title="' + _escape(title) + '" ';

}

if (align) {

html += 'align="' + _escape(align) + '" ';

}

html += 'alt="' + _escape(title) + '" ';

html += '/>';

return this.inserthtml(html);

},

这个官方的代码,在编辑时,插入的图片其代码为:

可是,于我想这张图能加放A标签的时,想达到的效果为:

 

于是我将kindeditor.js中的以上代码进行修改,修改结果如下:

insertimage : function(url, title, width, height, border, align) {

title = _undef(title, '');

border = _undef(border, 0);

var html = ''%20+%20_escape(url)%20+%20'

if (width) {

html += 'width="' + _escape(width) + '" ';

}

if (height) {

html += 'height="' + _escape(height) + '" ';

}

if (title) {

html += 'title="' + _escape(title) + '" ';

}

if (align) {

html += 'align="' + _escape(align) + '" ';

}

html += 'alt="' + _escape(title) + '" ';

html += '/>

';

return this.inserthtml(html);

},

这时,在编辑器里插入图片,一看代码能达的效果却少了一个属性,代码为:

 

不知道是什么情况:rel="lightbox[roadtrip]" 这段就不见了,

于我我换了一属性方式改为:class="A" 时, 却还是有的!就是不知道,为什么加入rel="lightbox[roadtrip]" 这个属性时为什么,就不行!

求解决!!小弟先谢过了!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值