is this code being executed within a dom ready callback? i.e. $(document).ready(); and are you sure all your images have their widths and heights fully loaded by the time this code is executed. Chrome tends to run a little faster than the other browsers so may highlight race conditions more readily. By 'miscalculated' do you mean off by a few pixels or just totally wrong?
–
PebblSep 17 '12 at 22:58

try alert() some of the variables or writing them to some html element. I would also check what is "this" referring to. is the code being called after the document has loaded?
–
MartinSep 17 '12 at 23:00

@Martin - this will definitely be referring to each element in turn that has the class 'centerImage' applied.
–
PebblSep 17 '12 at 23:06

Yes code is executed in $(document).ready(); and I am actually running it in a static local page so yes all images are perfectly loaded. in chrome, it just calculates margin left value and it's always equal -97! even if the case is that the image should be given margin top, it gives it the margin left value equals -97!
–
user63795Sep 18 '12 at 3:59