【发布时间】:2011-06-04 03:32:28
【问题描述】:
我已将问题提炼成显示问题的最短页面(对内联样式表示歉意)。
如果您向下滚动并拖动“拖动我”标题,请查看拖动的元素如何远离光标。它似乎移动了两倍的距离(相对于文档)。
我已经在 IE8、FF3.5 和 Chrome 中重现了这个问题。在 WinXP 和 Ubuntu 上。
我是在代码中做了一些愚蠢的事情,还是遇到了错误?
谢谢,
克里斯。
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".draggable").draggable();
});
</script>
</head>
<body>
<div style="width: 100px; height: 800px; background: green;">
</div>
<h1 class="draggable">drag me</h1>
<div style="width: 100px; height: 800px; background: green;">
</div>
</body>
</html>
【问题讨论】:
标签: jquery jquery-ui drag-and-drop