jQuery如何设置自增自减值

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

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

posted @ 2014-02-10 12:22  stephenykk  阅读(2159)  评论(0编辑  收藏  举报