Wrong default code in exercise 6


#1

The code for this exercise is actually incorrect. When you get to 6. Review the code is:

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

The .click(function) is incorrect. It Should be .click(function(). The default code is wrong and will throw a syntax error

and by default, the code $('.body') class is shown, instead of the $('body') element. If you fix these two pieces of code, the rest should work fine.


6.0 menu not functioning
#2

Hi Kcrow,

Thanks for letting us know about this! I'm not seeing what you are on exercise six, though. Here's the default code I see:

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

$(document).ready(main);

Is it possible you accidentally messed it up somehow? You can click the “Reset Code” button next to the blue “Save & Submit Code” button to reset your code :slightly_smiling: