Home >Backend Development >PHP Tutorial >UEditor 自定义toolbar,上传图片

UEditor 自定义toolbar,上传图片

WBOY
WBOYOriginal
2016-06-06 20:32:531256browse

UEditor版本:1.4.3 php
我自定义了toolbar,用如下的方式插入图片:

<code><a id="insertimage" href="#" onclick="ue.execCommand('insertimage', {src:'images/haha.png',width:'100',height:'100' })"><span class="fa fa-image"></span></a>
</code>

但是按照这样的话就只能把图片写死了,如何如何调出选择图片的窗口?

回复内容:

UEditor版本:1.4.3 php
我自定义了toolbar,用如下的方式插入图片:

<code><a id="insertimage" href="#" onclick="ue.execCommand('insertimage', {src:'images/haha.png',width:'100',height:'100' })"><span class="fa fa-image"></span></a>
</code>

但是按照这样的话就只能把图片写死了,如何如何调出选择图片的窗口?

你把这个onclick改成图片上传事件,选择以后再触发ue.execCommand('...事件不就可以了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn