为什么 javascript 给出这个错误?
Why javascript gives this error?
我最近在我的代码中添加了一个函数,但出现了这个错误:
缺少:在 属性 id
之后
这是函数,一切似乎都是正确的:
function movestt(blk)
{
var blkf=blk;
var blkr=blk;
TweenLite.to('#b'+blk, 0.0, {css:{background-color:'rgba(20,20,150,0.5)'}});
for(var i=0;i<=4;i++)
{
blkf++;
blkr--;
TweenLite.to('#b'+blkf, 0.0, {css:{background- color:'rgba(20,20,150,0.5)'}});
TweenLite.to('#b'+blkr, 0.0, {css:{background-color:'rgba(20,20,150,0.5)'}});
}
}
函数 运行 当单击页面上的某些按钮时。
我在其他函数中使用了 tweenlite 库,所以这不是原因。
有什么想法吗?
您应该使用 backgroundColor
而不是 background-color
或 background color
有效:
backgroundColor
"background-color"
无效属性:
background color
background-color
我最近在我的代码中添加了一个函数,但出现了这个错误:
缺少:在 属性 id
之后这是函数,一切似乎都是正确的:
function movestt(blk)
{
var blkf=blk;
var blkr=blk;
TweenLite.to('#b'+blk, 0.0, {css:{background-color:'rgba(20,20,150,0.5)'}});
for(var i=0;i<=4;i++)
{
blkf++;
blkr--;
TweenLite.to('#b'+blkf, 0.0, {css:{background- color:'rgba(20,20,150,0.5)'}});
TweenLite.to('#b'+blkr, 0.0, {css:{background-color:'rgba(20,20,150,0.5)'}});
}
}
函数 运行 当单击页面上的某些按钮时。 我在其他函数中使用了 tweenlite 库,所以这不是原因。
有什么想法吗?
您应该使用 backgroundColor
而不是 background-color
或 background color
有效:
backgroundColor
"background-color"
无效属性:
background color
background-color