如何将css3过渡缓和转换为jquery缓动函数?

Sto*_*art 7 jquery css3 easing css-transitions

我也为现代浏览器和旧浏览器制作滑块.我使用translate3d和transition来在支持css3的现代浏览器中制作动画.我为旧浏览器使用2d top,left和easing函数.我从这里使用css3缓动:

http://matthewlein.com/ceaser/

我想将它转换为javascript函数,以便在旧浏览器上使用.我知道那里有很多缓动功能,但我只是想知道如何转换.可能吗?

A.M*_*M.K 9

你可以在jQuery中使用Cubic Bezier Easings 的jQuery Bez插件:

演示: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?
Run Code Online (Sandbox Code Playgroud)

插件:https://github.com/rdallasgray/bez