Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 jHtmlArea 作为 cms 的文本编辑器。这完全适合我的客户需求。当单击以激活 jHtmlArea 时,我想要一个 div 上的双击功能。
如果有人遇到过类似的类型将帮助我创建。
使用 jHtmlArea 时,库会在所选 textarea 元素之前插入一个包含 iframe 的 div,然后隐藏原始元素。所以,你可以这样做:
jQuery("#trigger_div").dblclick(function () {jQuery("iframe",jQuery("#mytextarea").prev()).focus();});
(注意 iframe 必须与托管页面具有相同的域,否则您无法在其上触发或处理它的 javascript 事件)