jQueryIO 拖/放到 nicEdit 中的特定光标位置?
我正在尝试查看是否/如何使用 jQuery UI Droppable 插件将对象放入 nicEdit特定光标位置处的容器。
我在 此处看到了有关在 nicEdit 光标位置粘贴 html 代码的类似问题。
使用 jQuery UI Droppable 购物卡演示,我希望能够选择一个从产品区域中取出商品并将其放入购物车区域。但是,不是填充示例 div 的 drop 事件:
<div id="cart">
<h1 class="ui-widget-header">Shopping Cart</h1>
<div class="ui-widget-content">
<ol>
<li class="placeholder">Add your items here</li>
</ol>
</div>
我想将该对象放入与 nicEdit 控件关联的文本区域中。换句话说,我想将页面上的图标/对象拖放到活动光标位置的 nicEdit 文本区域中。删除图标将填充一些预定义的 html,并将其插入到 nicEdit textarea 对象中的光标位置。
任何建议表示赞赏。
I am trying to see if/how I can possibly use the jQuery UI Droppable plugin to drop an object into a nicEdit container at a specific cursor location.
I saw a similar question regarding pasting html code at a nicEdit cursor location here.
Using the jQuery UI Droppable shopping card demo, I want to be able to select an item from the products area and drop it into the Shopping Cart area. However, instead of the drop event populating the example div:
<div id="cart">
<h1 class="ui-widget-header">Shopping Cart</h1>
<div class="ui-widget-content">
<ol>
<li class="placeholder">Add your items here</li>
</ol>
</div>
I want to drop the object into a textarea associated with the nicEdit control. In other words, I want to drag an icon/object on the page and drop into the nicEdit textarea at the active cursor location. Dropping the icon will populate some predefined html to be inserted at the cursor location in the nicEdit textarea object.
Any suggestions are appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您会在这里找到部分答案:http://pastebin.com/sj8QA4xx。它展示了如何在 nicEdit 编辑器中的当前光标位置插入内容。我成功地使用该代码将预定义文本从库插入到 nicEdit 中,以响应按钮单击。我不知道拖放部分 - 如果在激活 nicEdit 后仍在接收事件,也许您可以拦截这些事件并将其绑定到此代码中。祝你好运!
I think you will find part of the answer here: http://pastebin.com/sj8QA4xx. It shows how to insert content at the current cursor location in a nicEdit editor. I am using that code successfully to insert pre-defined text from a library into a nicEdit, in response to button clicks. I don't know about the drag-and-drop part - if the is still receiving events after nicEdit is activated, perhaps you could intercept those and tie it into this code. Good luck!