热门关键字:
jquery > jquery教程 > jquery教程 > html5 缓动效果,html5缓动函数在动画中的应用

html5 缓动效果,html5缓动函数在动画中的应用

280
作者:管理员
发布时间:2021/7/29 19:08:29
评论数:0
转载请自觉注明原文:http://www.jq-school.com/Show.aspx?id=5181
  缓动类型:


  Linear:无缓动效果


  Quadratic:二次方的缓动(t^2)


  Cubic:三次方的缓动(t^3)


  Quartic:四次方的缓动(t^4)


  Quintic:五次方的缓动(t^5)


  Sinusoidal:正弦曲线的缓动(sin(t))


  Exponential:指数曲线的缓动(2^t)


  Circular:圆形曲线的缓动(sqrt(1-t^2))


  Elastic:指数衰减的正弦曲线缓动


  超过范围的三次方缓动((s+1)t^3 – st^2)


  指数衰减的反弹缓动


  每种类型都有三种缓动方式:


  easeIn:先慢后快


  easeOut:先快后慢


  easeInOut:先慢后快然后再慢


  封装的缓动函数:


  //Tween.js


  //t: current time(当前时间);


  //b: beginning value(初始值);


  //c: change in value(变化量);


  // d: duration(持续时间)。


  //you can visit '' to get effect


  var Tween = {


  Linear: function(t, b, c, d) { return c*t/d + b; },


  Quad: {


  easeIn: function(t, b, c, d) {


  return c * (t /= d) * t + b;


  },


  easeOut: function(t, b, c, d) {


  return -c *(t /= d)*(t-2) + b;


  },


  easeInOut: function(t, b, c, d) {


  if ((t /= d / 2) < 1) return c / 2 * t * t + b;


  return -c / 2 * ((--t) * (t-2) - 1) + b;


  }


  }




如果您觉得本文的内容对您的学习有所帮助:支付鼓励



关键字:jquery
友荐云推荐