I have a grid (div container) which looks like this:

However it’s possible that div #2 can be on the place of div #1 and so on. This is done via CSS position, so their DOM order will be the same.
I want to determine their visual order. Is there a jQuery selector or some other way to do this?
// SOLUTION ADDED AS ANSWER
Use
$(elem).position()to get screen coordinates for each div. By looking at thetopandleftproperties you can infer a visual ordering.