My code was correct, but the menu didn't change


#1

Hello all, Happy New Year!
While doing the interactive lesson, I notice that the menu bar wouldn't open for me. My code is correct because I was able to proceed through the lessons. Can any one explain why that might be? here is my code.

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

#2

@captain_tyga,

You are forgetting to close your icon-menu =click= Eventhandler
like

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

And in your icon-close =click= Eventhandler
you are NOT animating the body......


#4