Retrieving margin-left in Firefox & Opera
Stumbled onto this one: retrieving the margin doesn't seem to work in Firefox or Opera.
This is code I'm using, which works fine in Chrome, Safari and IE:
- var contentmarginl = parseInt($('#wrapper').css('marginLeft')); // fails
- var contentwidth = $('#wrapper').width(); // works
- alert(contentmarginl);
The alert returns (in my case) 350 in the complying browsers and 0 in FF and Opera.
Is this a bug or my error? Is there a known workaround?
EDIT: Just tested in XP sp3 IE7 & IE8. Returns Not a Number (NaN)
Thanks.