jquery Uncaught SyntaxError:意外的令牌 -

时间:2012-03-26 23:04:58

标签: javascript jquery syntax-error

我已经浏览了jQuery文档和谷歌,我似乎无法弄清楚这一点,尽管我有一种感觉,这可能是我很遗憾的事情。出于某种原因,我收到了这个错误,

  

未捕获的SyntaxError:意外的令牌 -

,每当我尝试执行我的脚本时,我都不知道为什么(我已经尝试了有和没有两个-负号的脚本,但它没有区别。)

这是我的代码:

$('.head').hover(function() {
    $(this).stop().animate({text-indent:'-60px'},100);
}, function() {
    $(this).stop().animate({text-indent:'-50px'},200);
});

1 个答案:

答案 0 :(得分:4)

尝试:

$('.head').hover(function() {
    $(this).stop().animate({'text-indent':'-60px'},100);
}, function() {
    $(this).stop().animate({'text-indent':'-50px'},200);
});