Reorder tiles within an area

I am trying to create a mesh grid that can be rebuilt. Tiles of different sizes. This is how far I got.

http://jsfiddle.net/psivadasan/dMtRs/

How to prevent rearrangement of tiles outside the gray area? I do not want this to happen: http://i.imgur.com/0JAfY.png

Appreciate any help.

+3
source share
1 answer

Just use the parameter containment: this will stop the movement of elements outside.

$('ul').sortable( "option", "containment", 'parent' );

http://jsfiddle.net/dazefs/dMtRs/7/

+3
source

All Articles