Let's say I have 5 div
vary in height and width with float:left;
:
When I use .css("");
to get their positions (left & right),
"auto"
would always end up be the result.
Any method to get the exact number (left & right) in pixels relative to the container (
position:absolute;
)?
(there are possibilities that the div
would start a new row as I use float:left;
and their widths and heights are undeterminable.)
jQuery has two methods for positions, one relative to document, and one relative to container.
Relative to container (position).
Relative to document (offset).
Note that position says relative to offset parent, so you might have to apply position: relative to the container element.