How to convert css3 transition easing to jquery easing function?

不问归期 提交于 2019-12-05 04:46:05

You can use the jQuery Bez plugin for Cubic Bezier Easings in jQuery:

Demo: http://jsfiddle.net/SO_AMK/sbZ7a/

jQuery:

$("#box").click(function() {
    $(this).animate({
        "margin-left": 200
    }, 2000, $.bez([0.685, 0.595, 0.020, 0.720]));
});

// Take the Ceaser output and put the values in, in order, like above. i.e. cubic-bezier(0.685, 0.595, 0.020, 0.720) would end up as the above value​

Plugin: https://github.com/rdallasgray/bez

I know the answer was already accepted, but i would like to share another great jQuery plugin suited for easing animations.

http://ricostacruz.com/jquery.transit/

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