Safari / Webkit Animating Font Size is Jumpy

有些话、适合烂在心里 提交于 2021-01-28 01:11:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!