3D transforms (translate3D) appear to be causing sluggish jQuery animations on mobile devices

陌路散爱 提交于 2019-12-08 02:55:27

jQuery's animate function is most likely the culprit in this scenario since it does not take advantage of hardware acceleration, which is needed for smooth performance on mobile devices such as the iPhone.

You could use the jQuery Animate Enhanced plugin, which overrides the jQuery animate function and uses css3 transitions instead. Here is a demo:

JS Fiddle Demo

$(".container").animate({
       'left': '-=' + 400 + 'px',
    'useTranslate3d': true
    }, 500);

I tested with an iPad. In fact, if you remove the reference to the jQuery Animate Enhanced library, you will see the performance degradation on a mobile device.

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