7. Close the Menu


#1

Ok, can't get my menu to close. It opens, looks fine, and the code passes the exercise... But it won't close! Help!

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

@spacecamel100,
[short version]
You will have to use jQuery's so-called class-Selector

$('.icon-close')

[long version]
= https://www.codecademy.com/forum_questions/55b3d3c1d3292f529b00005e


#3

thanks @leonhard_wettengmx_n - I knew it would be something simple!