text-align always return left by jQuery in IE
Not sure why text-align property always return left in jQuery for IE?
<script>
$(function() {
alert($('#ctl00').css('text-align'))
});
</script>
<span style="开发者_StackOverflow社区font-weight: bold; text-align: center;" id="ctl00">
this fixed the problem:
textAlignProp = $(this).css('textAlign');
using textAlign instead of text-align.
text-align won't work reliably inside a span, because it's not a block-level element. Test it out inside a div, and I think you'll find the results more predictable.
精彩评论