Masonry is an advanced jQuery plugin with various options. Since my knowledge in jQuery is limited, I cannot understand how it works by reading the masonry code. What is the basic jQuery API behind a plugin like this for re-arrangement of DIVs? I mean how we can basically and simply re-arrange DIVs with the aid of jQuery?
NOTE: As discussed in the comments, Masonry was an example for the behavior I am referring to. I want to know how jQuery can basically re-arrange the position of DIVs.
Ok, so let’s say you have 3 divs and you just want them arranged on load. Let’s say by height. Let’s also say for this example that you don’t care to animate them, you just want them arranged by height.
Here’s the jsfiddle:
http://jsfiddle.net/hMmLd/1/
using jquery I sort the elements by height then re-draw them in their new order on the screen.