The simplest code:
var marginleft = jQuery(this).find(".image").css("margin-left"); var paddingleft = jQuery(this).find(".image").css("padding-left"); The result is given with integers. The problem is that if the margin is set via em, then Chrome calculates it with decimal values, and Firefox rounds off the values. As a result, I can’t precisely position an element in chrome, there’s always a 1px brute force, since we’ll say the calculated margin-left is 23.9998, and jQuery only gives 23.
pxeven ifemis specified. Because These are calculated fields usinggetComputedStyle(node)- Vasily Barbashev