Code correct but no menu


#1

This is my complete code as accepted:

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);

The menu does not even open when I click it, let alone close when it's supposed to. My code is said to be correct, but I see a red text under the preview window to the right that says "Uncaught SyntaxError: Unexpected token ."


#2

Hi Leonarddawinci,

You need to remove the semi-colon (;) on line 2, because the computer interprets a semi-colon as something that ends a statement, but you're trying to continue something.
Also, the first }); needs to be removed, because it's closing $('.icon-menu').click(...); prematurely.

I hope this helps :slightly_smiling:


#3

Thank you so much :slightly_smiling: