问题
Animating font sizes in Firefox has a nice smooth effect, while in Safari (and Chrome but less so) it is jumpy. By jumpy I mean the kerning and rendering on the text does not change smoothly, as if Safari is not able to keep up with the font sizes changing so fast.
font size starts at 10px:
$('#myel).animate({fontSize:'20px'}, 300);
Is this normal behavior and is there some sneaky fix for this?
回答1:
I believe this is down to rounding. Both in how font sizes are rendered and in how those fonts (at their new sizes) are placed within the document flow. Since 1px is the smallest real-world unit of measurement, there is potential for something to 'give'.
I recently saw a fix for a similar issue, which involved absolutely positioning the element with the animated font size. I don't know if that's an option for you.
来源:https://stackoverflow.com/questions/7897508/safari-webkit-animating-font-size-is-jumpy