Hi there,
I have two items that I am floating right in my XHTML page. Unfortunately, when I try to get the offset of the right most item... it comes back as the position the element would be in if it were not floated.
<div id="Left style="float:right"></div>
<div id="right" style="float:right"></div>
Using Jquery
<script type="text/javascript">
var right = $("#right");
alert(right[0].offsetLeft);
</script>
Do I have to do something like this?
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent)
{
do
{
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
}