Jquery UI resizable issue expands beyond containment (draggable also used)

大兔子大兔子 提交于 2019-12-05 20:30:02

Adding a position:relative; to the container solves the issue.

See this working Fiddle Example!

#ParentDIV {
    position: relative;
}

If your draggable element is absolutely positioned and your container is absolutely positioned you can set the dragged element to a fixed width and height. This will create a bounding box and prevent the draggable from falling off the edges.

#container {
    position:absolute;
}

#draggedObject {
    position:absolute:
    width: 100px;
    height: 50px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!