$('body') inside $('.icon-close').click()


#1

Hi all

Please help, for the life of me I cannot figure this out, even with what I have read on forum (which was helpful too).
the error I get states that I am missing ) after argument list

. what argument list??!! I've also checked all the brackets and they all in pairs.

here is my code:

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

thanks in advance.


#4

Hi Iklyus,

That selects the body class. You want the body tag. So, try making it like this:

$('body')