2013-01-15 64 views
0

我在代码中遇到了小问题,我确定这只是我无法找到的。错误“未捕获的SyntaxError:意外的标识符”

有人可以帮助我吗?

我得到这个:

Uncaught SyntaxError: Unexpected identifier

$(document).ready(function(){ 
    $('#zone1').mouseover(function(){ 
     $('#cercle2-1').fadeIn(200); 
    } 
    $('#zone1').mouseout(function(){ 
     $('#cercle2-1').fadeOut(200); 
    } 
}); 

预先感谢您。

回答

1

该代码缺少两个右括号来关闭函数调用。

$(document).ready(function(){ 
     $('#zone1').mouseover(function(){ 
     $('#cercle2-1').fadeIn(200); 
     }); //Need right paren and semi to finish statement 
     $('#zone1').mouseout(function(){ 
     $('#cercle2-1').fadeOut(200); 
     }); //Need right paren and semi to finish statement 
    }); 
+0

谢谢......我真是个白痴:) – Clemeeent

+0

@Clemeent很高兴我能帮到你。别担心它发生在每个人身上,诀窍在于继续前进。并非所有事情都在第一次尝试中发生 –

+0

@KevinBowersox也许你也可以显示OP,他可以链接方法,而不是两次使用选择器。 – andlrc

相关问题