I am using jQuery to get some CSS properties from an element, using .css('prop')
.
On iOS, jQuery returns 0px
when the margin-left
property is set to auto
. This doesn't happen anywhere else I tested, and it's not due to device-specific rules being applied.
To be double sure of the latter, I also inspected the code in WEINRE, where the inspector shows the correct auto
values.
Q:
Any idea why jQuery is returning 0px
instead of auto
?
Code used to access the CSS property in question (just pre-caching stuff):
this.data.marginRight = this.$el.css('margin-right')
// Firefox returns 'auto'
// Chrome returns 'auto'
// Safari returns 'auto'
// Mobile Safari returns '0px'