简体   繁体   English

Jquery动画缓和

[英]Jquery animate easing

Quick question : how do I call jQuery's animate() without any easing parameters? 快速提问:如何在没有任何缓动参数的情况下调用jQuery的animate() eg without any effects. 例如没有任何影响。

Cheers! 干杯!

Write

$('#elem').animate({
    top: '0px',
    left: '0px'
}, 5000, 'linear');

Extract from jQuery API : jQuery API中提取:

The only easing implementations in the jQuery library are the default, called swing , and one that progresses at a constant pace, called linear . jQuery库中唯一的缓动实现是默认的,称为swing ,以及一个以恒定速度进行的实现,称为linear

只需省略缓动参数即可。

Taken from the documentation: 取自文档:

$('#clickme').click(function() {
  $('#book').animate({
    opacity: 0.25,
    left: '+=50',
    height: 'toggle'
  }, 5000, function() {
    // Animation complete.
  });
});

you just don't write the easing parameter 你只是不写缓动参数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM