假设我有以下 HTML 文件:
** 主.html **
<html>
<body>
<ul>
<li>Element to drag</li>
</ul>
<iframe src="demo.html">
</iframe>
</body>
</html>
demo.html(iframe 代码)
<body class="iframe">
</body>
我正在使用 jquery UI 进行拖放 ( Link ) 并假设所有 javascript 文件都包含在 main.html 和 demo.html 中
任何帮助都会很有帮助!!! 谢谢
最佳答案
我遇到了同样的问题,并设法以这种方式做到了。
正常考虑主文件中的可拖动元素,并引用 iframe 可放置元素
$( 'your-iframe' ).contents().find( 'elments-you-want-droppable' ).droppable({
// droppable settings here as normal
});
关于javascript - 如何从 HTML 外部拖放 iframe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6748297/