Push the Menu (Close the menu)


#1



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


Oops, try again. Use the line $('.icon-close').click(); inside your main function.


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 Emad,

Carefully compare the error message to your code.

Error message:

$('.icon-close')

Your code:

$('icon-close')

See the difference? :slight_smile:


#3

Oh my goddddd! how I didn't see this? lol
Thank you very much!!


#4

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