I have the following:
var offset = {top: target.offset().top + target.height() + 3,
left: target.offset().left};
target.offset(offset);
this happens on $(document).ready(..)
However, in chrome, the target object is not positioned with the appropriate height. When I placed an alert(..)
to show the actual height, I saw the reason - target.offset().top
returns less than desired because at that moment an image still isn't loaded (the alert blocks the loading of the page and this becomes visible).
I fixed the issue by specifying an explicit height
of the <div>
around the image, but is there a better way?