在父框架和子 iframe 之间拖放元素 [英] Drag-Drop elements between parent frame and child iframe
问题描述
我正在尝试使用 jQuery 在父框架和 iframe 之间拖放元素.我在父框架中有一个面板,其中包含一些可拖放到子框架上的可拖动项目.我试图搜索很多,但找不到很多...
I am trying to drag-drop elements between parent frame and iframe using jQuery. I have a panel in parent frame which contains some draggable items which can be dropped on the child frame. I tried to search a lot but couldn't find much...
我试图通过在子框架内附加元素然后尝试以编程方式在新插入的元素上触发可拖动来解决它,但我也被困在那里.找不到触发拖动功能的正确方法.(可拖动元素有一个助手.当我通过触发mousedown.draggable"触发拖动时,ui-draggable 元素上的位置会发生变化,但我看不到助手.
I tried to work around it by appending the element inside the child frame and then trying to trigger draggable on the newly inserted element programmatically, but I got stuck there as well. Couldn't find the proper way to trigger the drag function. (The draggable element has a helper. When I trigger drag by triggering "mousedown.draggable" the position on the ui-draggable element changes but I cannot see the helper.
谢谢!!
推荐答案
使用 HTML5 Drag and Drop API 创建跨框架和跨浏览器实现.http://blog.stackhive.com/post/137799349684/building-a-seamless-drag-and-drop-interface
Using HTML5 Drag and Drop API to create Cross Frame and Cross Browser Implementation. http://blog.stackhive.com/post/137799349684/building-a-seamless-drag-and-drop-interface
编辑 - 之前的链接无效(dockPHP 更名为 StackHive),因此写了一篇更完整的文章,可以帮助创建史诗般的拖放界面.
EDIT - The previous link wasn't valid (dockPHP got rebranded as StackHive) so have written out a more complete post that can help in creating an epic drag and drop interface.
这篇关于在父框架和子 iframe 之间拖放元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!