Leonardo Lacerda
Leonardo Lacerda

Reputation: 397

Drag and drop - not drop out of droppable

I have a project drag and drop + clone + resizable, so far I've managed to do everything right. I can clone an element and this element can be resized (resizable)

However, the problem is :
I clone elements and game area are droppable and may leave the area and stay droppable across the screen (they can only be cloned when the game element droppable area but after being cloned they can be dragged around the screen)
I wonder if there's any way to make that they can only be dragged within the droppable area, can not leave the droppable

PS: sorry if the English is wrong, I'm using google translator..

Upvotes: 1

Views: 263

Answers (1)

Kasyx
Kasyx

Reputation: 3200

If you are using jquery-ui its possible. Just use containment with selector on your area. Check this example for more information.

Upvotes: 1

Related Questions