Close The Menu - confused


#1



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


I'm confused as to exactly what my problem is (with this code I mean, not metaphyscially). It does what it's meant to do (opens and closes the menu), but I get an error which reads.....

"Oops, try again. Remember to add code for $('body') inside $('.icon-close').click(). Look back at the instructions for the code."

I did add the 'body' inside the icon-close click, look Mr Codecademy, it's right there (points)

Please could someone put me out of my misery? Thank you very much.


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

body is not a class , body is html tag

dont use . to select body tag

$('.body') // remove .


#3

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