Take a look at this jsfiddle where I modified the left CSS property by appending "px" to it:
function adjustLeft(leftVal) {
var left = parseFloat(leftVal);
//tooltip.style.left=left;
tooltip.style.left=left + "px";
log("left: " + left + ", width: " + tooltip.offsetWidth);
}
I tested the function with the following values:
adjustLeft(0.1);
adjustLeft(0.2);
adjustLeft(0.3);
adjustLeft(0.4);
adjustLeft(0.5);
adjustLeft(0.6);
adjustLeft(0.7);
adjustLeft(0.8);
adjustLeft(0.9);
The output log showed the following results:
left: 0.1, width: 155
left: 0.2, width: 155
left: 0.3, width: 155
left: 0.4, width: 155
left: 0.5, width: 154
left: 0.6, width: 154
left: 0.7, width: 154
left: 0.8, width: 154
left: 0.9, width: 154
Upon reaching a certain point, Chrome seems to alter the offsetWidth value. I'm running the latest version of Chrome "37.0.2062.124 m". Interestingly, if I exclude the "px", the function behaves consistently. Do you think this could be a bug?