如何将自定义宽度参数设置为 tinymce 创建的 img 标签? [英] How to set custom width parameter to img tag created by tinymce?
本文介绍了如何将自定义宽度参数设置为 tinymce 创建的 img 标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为tinymce创建的img标签设置自定义宽度参数?
How to set custom width parameter to img tag created by tinymce?
我的意思是,当您在 textarea 中插入图像时,如何将其宽度更改为某个自定义值?Image manager config没有提供这样的功能所以我想修改这个脚本,只需要知道从哪里开始
I mean when you inster the image in textarea, how to change it's width to some custom value ? Image managers config does not provide such feature so I want to modify this script, just need to know where to start
已解决这是我在 tinyMCE 初始化块中添加的脚本
SOLVED Here is my script that I added in tinyMCE initialization block
imagemanager_insert_template : function(fo, enc) {return '<img src=\"' + enc.xmlEncode(fo.url) + '\" width=\"$width_mini\" height=\"' + $width_mini/(fo.custom.width/fo.custom.height) + '\"/>';
},
这就行了.
推荐答案
已回答但将作为回答发布以便其他人看到此问题有解决方案
Already answered but will post as answer so others will see that there is a solution for this problem
imagemanager_insert_template : function(fo, enc) {return '<img src=\"' + enc.xmlEncode(fo.url) + '\" width=\"$width_mini\" height=\"' + $width_mini/(fo.custom.width/fo.custom.height) + '\"/>';
},
这篇关于如何将自定义宽度参数设置为 tinymce 创建的 img 标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文