I’ve got this piece of code
http://jsfiddle.net/THnan/
but everytime I sort an element I would like to check how many children has the destination div and if they’re more than N code should take the last child of the destination div and put it at the BEGINNING of the start div (even if the last child is the new sorted element).
I hope I put it clear.
How can I achieve this behaviour?
Thank you in advance!
Well, here’s a “naive” (as in, take the first approach that jumps to mind) version, using sortable’s
receiveevent. UsedNto signify the max number of elements on either side.http://jsfiddle.net/3NBT7/1/
If resorting depended on side, I’d use if/else instead:
http://jsfiddle.net/3NBT7/4/