【发布时间】:2014-03-11 04:37:58
【问题描述】:
两个程序:
-one 有一个可拖动的 div,里面有一个 iframe。
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script>
$(function() {
$( "#draggable" ).draggable();
});
</script>
<style>
#draggable { width: 1500px; height: 300px; }
</style>
</head>
<body>
<div id="draggable" class="ui-widget-content" style="background:#ccc">
<p>Drag me around</p>
<iframe src="test.php" style="background:#eee;width:100%;height:240px;" frameborder='0' ></iframe>
</div>
</body>
-另一个,iframe程序
<body>
<div onclick="alert('Clicked here')">Just a test with an input</div>
<input type="text" id="txtid">
</body>
场景:我在 div 内点击鼠标按钮开始拖动,然后将鼠标从 div 快速拖动到 iframe 内。我失去了可拖动的能力(没关系,我可以带着这个离开)。但是随后,我松开鼠标按钮并将其移出 iframe...一旦鼠标触摸 div repeat: without the mouse button press,拖动将保持活动状态.
这是拖动方法的错误还是功能? 如何强制停止拖动行为?如果你尝试一下,你会发现这是一个非常烦人的行为。
TIA,
【问题讨论】:
标签: javascript jquery html jquery-ui iframe