Uncaught SyntaxError: Unexpected token . after argument list


#1

I have seen many people with the same uncaught syntax errors, but I can't seem to understand what they did wrong. Also none of them had a . that was wrong and I even looked at the hints copied it and put it in as my code but it still didn't work. Also my menu didn't open at all and my code is the exact same or so I thought.

Here is my code can you help me figure out where i went 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 Raine,

Take a close look here:

here:

and here:

:slightly_smiling:


#3

There is no dot before 'icon-close' or was I not supposed to put a . before '.icon-menu'


#4

@meisme353

  1. You can't have a semi-colon anywhere on that line, and you need to open your function with an opening curly brace ({).
  2. Same as above, but (you caught this) you need a dot (.) in front of icon-close.
  3. 200 needs to be inside the parentheses. That line should look like this:

}, 200);

#5

Thank you. I understand what I did wrong now