mar*_*zzz 6 jquery drag-and-drop jquery-ui mouseevent
试试这段代码:
<div class="draggable_container">
<div id="draggable_1" class="draggable">
<div class="exp"><!-- --></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
html
{
height:3000px;
}
.draggable_container
{
height:300px;
background-color:red;
width:140px;
}
.draggable
{
height:60px;
width:130px;
cursor:pointer;
border:5px solid #000000;
background-color:#ffffff;
}
Run Code Online (Sandbox Code Playgroud)
$(".draggable").draggable({
axis: "y",
containment: 'parent'
});
Run Code Online (Sandbox Code Playgroud)
现在,如果您单击"可拖动"框并上下移动鼠标,它将移动到容器高度.
但是,如果用鼠标单击此框,然后滚动页面(使用鼠标滚轮......或将光标移动到底部,而不释放鼠标),框就会越过容器.而这很糟糕.
这是一个常见的bug吗?我该如何解决这个问题呢?
归档时间: |
|
查看次数: |
2879 次 |
最近记录: |