为什么以下工作?
<something>.stop().animate(
{ 'top' : 10 }, 10
);
Run Code Online (Sandbox Code Playgroud)
虽然这不起作用:
var thetop = 'top';
<something>.stop().animate(
{ thetop : 10 }, 10
);
Run Code Online (Sandbox Code Playgroud)
为了使它更清晰:目前我无法将CSS属性作为变量传递给animate函数.