All you need to use is this simple Javascript function:
object.getBoundingClientRect();
It is supported in:
Chrome Firefox (Gecko) Internet Explorer Opera Safari
1.0 3.0 (1.9) 4.0 (Yes) 4.0
Look here for more about it. Link