用jQuery实现时出错,请大神帮看看
var $li = $('li'); $li.on('mouseover', function () { mutipleMove($(this), 400) }) $li.on('mouseout', function () { mutipleMove($(this), 200) }) function mutipleMove(obj, target) { clearInterval(obj.timer); var speed = 0; if (obj.width() > target) { speed = -10; } else { speed = 10; } obj.timer = setInterval(function () { if (obj.width() == target) { clearInterval(obj.timer) } else { obj.css({ 'width': '+=' + speed + '' }) } }, 30) } 哪里错了??