jQuery and margin: 0 auto

Posted by Trevor Burnham on Stack Overflow See other posts from Stack Overflow or by Trevor Burnham
Published on 2010-06-12T15:34:08Z Indexed on 2010/06/12 15:43 UTC
Read the original article Hit count: 304

Filed under:
|
|
|

So, this is a problem that's been asked before, but I'm hoping we can lay it to rest: I'm using jQuery 1.4. If I define the style

#obj { margin: 0 auto; }

and then do

$('#obj').css('marginLeft');

the result is the computed value in pixels. Is there any way to tell whether those pixels come from the auto calculation or not, without parsing document.styleSheets?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery