jQuery animate() - 使用相对值 在值的前面加上 += 或 -=

Posted 永醉雨辰

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery animate() - 使用相对值 在值的前面加上 += 或 -=相关的知识,希望对你有一定的参考价值。

也可以定义相对值(该值相对于元素的当前值)。需要在值的前面加上 += 或 -=:

实例

$("button").click(function(){
  $("div").animate({
    left:‘250px‘,
    height:‘+=150px‘,
    width:‘+=150px‘
  });
});

以上是关于jQuery animate() - 使用相对值 在值的前面加上 += 或 -=的主要内容,如果未能解决你的问题,请参考以下文章