【发布时间】:2013-07-11 16:33:49
【问题描述】:
我正在尝试将图像拖到 jquery 文本编辑器 (jqte) 中,然后在编辑器中调整它的大小。由于调整大小功能仅在 Firefox 中有效。所以我想在 mouseenter 上提供 W 和 H 文本框来改变大小。但是 mouseenter 对 img 元素不起作用。
<div class="jqte_editor" contenteditable="true"><pre style="font-family:consolas;">
<br>
<img style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(255, 255, 255); border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 255, 255);" src="http://localhost:65380/Articles/ArticleImageStore/cf82c9c8-3ea0-4c7f- 9272-7b2fd48a9eed/79825f3f-965f-4e34-ad45-3fa7430e6837.JPEG" width="64" height="64" id="img6">
</pre>
<p><br></p>
<pre style="font-family:consolas;"> </pre> <p></p>
</div>
jquery代码sn-p
$('.jqte_editor img').on('mouseenter', function() {
alert("hello");
$(this).before("<div style='position:absolute'><input type='textbox'></input></div>");
});
【问题讨论】:
-
你能用小提琴重现这个问题吗?
-
jsfiddle.net/ZJm2X@techfoobar
-
移除
$(document).ready(...);包装器,因为 jsfiddle 已经在页面加载时执行您的代码。检查这个:jsfiddle.net/ZJm2X/2 -
JQTE 内部没有任何工作..
-
你查看我发布的小提琴链接了吗?
标签: javascript jquery html jqte