我已经使用 jquery UI 实现了拖放功能。
这是它的 js fiddle ( http://jsfiddle.net/metm0v0f/)。
当我将一个 div 从一个 div 放到另一个 div 时,我想限制高度的增加。我试图限制 css 类:
overflow-x: hidden;
overflow-y: hidden;
但它仍然在增加高度。谁能帮我固定容器尺寸?
最佳答案
只需将这两行添加到 dbContainer1、dbContainer2 类:
.dbContainer1 {
width: 40%;
float: left;
border: dotted 1px red;
/*add the following lines*/
height:250px;
overflow-y:scroll;
}
.dbContainer2 {
width: 40%;
float: left;
border: dotted 1px green;
/*add the following lines*/
height:250px;
overflow-y:scroll;
}
关于javascript - jQueryUI : restrict container height on drag and drop element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47966987/