【发布时间】:2018-01-30 06:54:35
【问题描述】:
为什么以下工作有效?
<something>.stop().animate(
{ 'top' : 10 }, 10
);
而这不起作用:
var thetop = 'top';
<something>.stop().animate(
{ thetop : 10 }, 10
);
为了更清楚:目前我无法将 CSS 属性作为变量传递给 animate 函数。
【问题讨论】:
-
谢谢。正在寻找确切的东西
-
不客气!
标签: javascript jquery variables properties object-literal