为什么拖动的层在含有iframe的区域里面拖动的速度好慢好卡? 
不能快速拖动,拖动的速度快的时候,鼠标左键松开后,再移动到拖动层的上面,拖动层还会随着鼠标跑!不知道怎么回事?
<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; " />
<title>Draggables demo - Interface plugin for jQuery</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="iutil.js"></script>
<script type="text/javascript" src="idrag.js"></script>
<style type="text/css" media="all">body
{
background: #fff;
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
}.draggable {
position: absolute;
width: 80px;
height: 40px;
border: 1px solid #0090DF;
background-color: #68BFEF;
padding: 10px;
text-align: center;
}#parentElem
{
width: 402px;
height: 160px;
background-color: #FFDFDF;
border: 10px solid #900;
padding: 20px;
top: 150px;
left: 0px;
position: absolute;
overflow: hidden;
margin: 10px;
color: #000;
border-left-width: 10px;
}
#insideParent
{
width: 100px;
height: 100px;
background-color: #9c0;
color: #fff;
}#drag7
{
top: 80px;
left: 250px;
}
#drag7 div
{
cursor: move;
background-color: #900;
height: 15px;
}
#drag8
{
top: 80px;
left: 370px;
}
.frameClass
{
border: 1px dotted #999;
}
</style>
</head>
<body><div id="drag7" class="draggable"><div></div>请拖动上面有颜色的地方</div><script type="text/javascript">
$(document).ready(
function()
{

$('#drag7').Draggable(
{
handle: 'div'
}
);
$('#insideParent').Draggable(
{
zIndex:  1000,
ghosting: false,
opacity:  0.7,
containment : 'parent'
}
); }
);
</script><br><br><br>
<br>为什么拖动的层在含有iframe的区域里面拖动的速度好慢好卡? 
<br>不能快速拖动,拖动的速度快的时候,鼠标左键松开后,再移动到拖动层的上面,拖动层还随着鼠标跑!不知道怎么回事?
<br><br><br><iframe src="http://www.google.com/search?q=javascript" id="mainFrame" height="500px" width="600px"></iframe> 
谢谢各位.</body>
</html>

解决方案 »

  1.   

    我使用的是jquery的拖动,jquery.js,idrag.js,iutil.js,只要使用了iframe,不用jquery用其他的拖动也是不能快一点拖,懵了......
      

  2.   

    主要是mousemove事件不能穿透iframe,当鼠标移动到iframe时就没有办法移动了,所以会有顿滞感。修正办法可以在拖拽时生成一个类似透明的遮罩层盖住页面上所有的东西就会好很多。
      

  3.   

    昨天已经说过的问题了,只要设置zIndex ,然后就可以让你拖动的 东西在框架上面,但鼠标放开后,当然还是原样,
    这样就不要弄个透明的遮罩层(这个比较麻烦)