Cannot proceed, says i am missing $(document).ready(main);


#1

I am not really sure as to why i cannot proceed to the next lesson as i do have line of code $(document).ready(main); within my code here:

var main = function() {
//move body and nav over
$('.icon-menu').click(function() {
$('.menu').animate({
left: "0px"
}, 200);

$('body').animate({
    left: "285px"
}, 200);
});

//moves body and nav to original postition
$('.icon-close').click(function() {
    $('.menu').animate({
        left: "-285px"
}, 200);

$('body').animate({
    left: "0px"
}, 200);
});

};

$(document).ready(main);

I want to say that there is a problem with the webpage it self as i have compared the entire code to the preview code, but I may be wrong and that is why i am asking for some help here.


#2

@coursejumper02261,

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

    //moves body and nav to original postition
     $('.icon-close').click(function() {
          $('.menu').animate({
                 left: "-285px"
                 }, 200);

          $('body').animate({
               left: "0px"
               }, 200);
      });
};

$(document).ready(main);

I tested your code in a windows 8.1 IE11 environment and it functioned....

Maybe...

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#3

am facing the same challenge but even refreshing or resetting code has not helped