var thetop = "top";
// create the object literal
var aniArgs = {};
// Assign the variable property name with a value of 10
aniArgs[thetop] = 10;
// Pass the resulting object to the animate method
<something>.stop().animate(
aniArgs, 10
);
我只想把top,right,left作为一个属性,而不是像上面代码那样整个东西
答案 0 :(得分:0)
$('selector').stop().animate({top:100, left:100});
答案 1 :(得分:0)