因此“元素”是可拖动的,但是当我尝试将它移出可滚动 容器时它会消失。我试过使用 z-index 但它似乎不起作用。知道哪里出了问题吗?
工作笔:https://codepen.io/anon/pen/ZaXVaE
body {
background-color: lightyellow;
}
.container {
height: 500px;
width: 300px;
margin: 0 auto;
overflow-y: scroll;
background: #ccc;
}
.item {
border: 1px solid blue;
width: 100px;
margin: 0 auto;
z-index: 9999;
}
<div class="container">
<div class="item">
Move me
</div>
</div>
$(".item").draggable({revert: true});
最佳答案
因为.container
有overflow: scrooll
。这不会像这样溢出可见
关于jquery - 将元素拖到可滚动容器外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47331460/