Uncaught SyntaxError: Unexpected token


#1

Hi, who can help me? what I wrote wrong ?

var main = function() {
$('.icon-menu').click(function();
$('.menu').animate({
left: "0px"
},200)
$('body').animate({
left: "285px"
},200)
$('.icon-close').click(function()
$('menu').animate({
left: "-285px"
},200)
$('body').animate({
left: "0px"
},200)
};
$(document).ready(main);


#2

Hi Semakinjohn,

Take a look at these:

(↑ working)

(↑ not working)

(↑ not working)

Can you spot the difference causing trouble between the second two and the first one?

Hint

The second two are missing their opening curly brace ({) aright after their parenthesis, and the second one shouldn't have a semi-colon there.


#3

Oh got it, Thanks a lot :wink:


#4

Thank you so much. I was stuck for a while.


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.