jQuery animate() 和缓动类型
jQuery animate() and easing type
我有这个:
$('h1').animate({
//stuff to be changed,
}, {
duration: 1000,
queue: false
})
改成这样不接受:
{
duration: 1000,
queue: false,
easing: easeOutBounce
}
当以字符串形式提供 easing
时,出现此错误:
Uncaught TypeError: n.easing[this.easing] is not a function
我应该如何放置缓动类型?
缓动应该是一个字符串,像这样:
{
duration: 1000,
queue: false,
easing: 'easeOutBounce'
}
关于 .animate()
状态的 API 文档:
easing (default: swing
)
Type: String
A string indicating which easing function to use for the transition.
我有这个:
$('h1').animate({
//stuff to be changed,
}, {
duration: 1000,
queue: false
})
改成这样不接受:
{
duration: 1000,
queue: false,
easing: easeOutBounce
}
当以字符串形式提供 easing
时,出现此错误:
Uncaught TypeError: n.easing[this.easing] is not a function
我应该如何放置缓动类型?
缓动应该是一个字符串,像这样:
{
duration: 1000,
queue: false,
easing: 'easeOutBounce'
}
关于 .animate()
状态的 API 文档:
easing (default:
swing
)Type: String
A string indicating which easing function to use for the transition.