开发者

How to drag an item out from an Iframe and drop onto the parent

开发者 https://www.devze.com 2023-01-03 03:52 出处:网络
I have a folder tree view on the left page which was in a <div> tag. The left page was the iframe container which contained the file list.

I have a folder tree view on the left page which was in a <div> tag. The left page was the iframe container which contained the file list.

When I want to drag th开发者_JS百科e files out from the iframe, I got a headache. No matter if the containment option was set to 'parent' or 'window', I just can't drag out elements in the iframe container.

How can I do this?


If someone wants to drag an element out from an iframe to a parent document here I made jQuery plugin for it:

https://github.com/Vatia13/dragoutfromiframe


Interacting between iframes and the parent frame can be challenging (if not impossible if the iframe holds content from another website/domain). Dependent on the situation, using a DIV, populated with content (either directly through PHP, or by using the jQuery $.load() function) may be a better option.

Then the dragged object and its target are within the same page - much simpler.

0

精彩评论

暂无评论...
验证码 换一张
取 消