Moveable: Is there a way to restrict the dragable element so it cannot be dragged outside of it's container?

Created on 29 Apr 2020  路  2Comments  路  Source: daybrush/moveable

Environments

Description

Is there anyway to restrict where draggable element can be dragged. For example in the testatble address I have added a red container, I do not want the draggable element to be able to dragged out of it's container. Is this possible ?

Many thanks

question

Most helpful comment

U need to use
snappable: true, option with
bounds: { left:0, top: 0, right:el.width(), //200 bottom:el.height() //200 } for example

https://codepen.io/Vronn/pen/eYpEJvq

All 2 comments

U need to use
snappable: true, option with
bounds: { left:0, top: 0, right:el.width(), //200 bottom:el.height() //200 } for example

https://codepen.io/Vronn/pen/eYpEJvq

Thanks a lot really appreciate it thats what i was looking for :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Xumochuan picture Xumochuan  路  6Comments

monsterooo picture monsterooo  路  4Comments

wassgha picture wassgha  路  6Comments

tesmem101 picture tesmem101  路  3Comments

probil picture probil  路  4Comments