【问题标题】:drag(move) jquery ui dialog box outside the iframe area在 iframe 区域外拖动(移动)jquery ui 对话框
【发布时间】:2013-02-27 11:04:12
【问题描述】:

我在 iframe 中打开了 jquery 可拖动对话框。它在 iframe 内工作正常,但我无法将 jquery 对话框拖到 iframe 之外。我想将对话框拖到 iframe 之外。有人知道我该怎么做吗?

以下是我在movable.php文件中使用的示例代码。

<html>
<head>
<link href="http://www.jquerydemo.dailyfreecode.com/Styles/Site.css" rel="stylesheet" type="text/css" />
<link href="http://www.jquerydemo.dailyfreecode.com/Styles/css/sunny/jquery-ui-1.8.22.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<style>
.ui-dialog
{
position:relative !important;
top:0px !important;
}
</style>
</head>
<body>
<a id="hlOpenMe" href="#">Click Me to Open Dialog Box</a>
<div id="dialog" title="My Dialog Title">
<p>This is My Dialog box Description/Content</p>
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#dialog").dialog({ autoOpen: false });

$("#hlOpenMe").click(
function () {
$("#dialog").dialog('open');
return false;
}
);
});
</script>
</body>

现在我在 demo.php 页面中调用了 iframe。

<iframe src="movable.php" id="name" name="test" width="50%" height="50%">
</iframe>

【问题讨论】:

  • 嘿伙计,知道这个问题的一个答案。这对他很重要。
  • Thanx manish,但我认为没有人能回答这个问题。这超出了他们的想法。

标签: jquery html iframe


【解决方案1】:

你不能这样做。对于您的脚本,浏览器窗口是调用它的 iFrame。 jQuery 不知道 iFrame 的存在和“外部”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-05
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 2011-11-06
    相关资源
    最近更新 更多