jQuery如何设置自增自减值

一直不是很记得jquery中怎么设置自增值,比如当点击按钮时 div在当前宽度基础上增加宽度100px,可以这样写:

$('button.test').click(function(){ $('div.test').animate( { "+=100px", height:"+=100px"}, 'normal'); // ~~ +=100px,单位px可以省略

原文地址:https://www.cnblogs.com/stephenykk/p/3542634.html