5/8 'open the menu'


#1



https://www.codecademy.com/courses/web-beginner-en-zmn0b/0/5?content_from=make-an-interactive-website%3Ayour-first-program


The error message I get is:
Oops, try again. It looks like the '.menu' didn't animate into the screen. Check your $('.menu').animate() function.

Incidentally, this is the exact code in the 'hint' section. If Codecademy's provided code doesn't work for their exercise, figure a bug but not sure. Tried across Chrome, Firefox, Safari and received the same error message.


var main = function() {
  $('.icon-menu').click(function() {
    $('.menu').animate({
      left: '0px'
    }, 200);

    $('body').animate({
      left: '285px'
    }, 200);
  });
};


#2

All your code is right, you are just missing on small important line of code at the end. Hint: the line of code you are missing prepares your document, and it runs the 'main' function. If you have done jQuery then you ought to know this, but the line of code you are missing looks like this:

$(document).ready(main);


#3

Cheers! Totally missed this, missing semicolon writ large :slight_smile: