Passes but doesn't work


#1

Hey all,

My code passes, but the menu isn't opening at all...

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

    $('body').animate({
      left: "285px"
    }, 200);
  });
  
  $(',icon-close').click(function() {
      $('.menu').animate({
          left: "-258px"
      }, 200);
  });

$(document).ready(main);

#2

Hi John,

You've got two problems in your code that I can see right off.

  1. $(',icon-close') needs to use a dot (.) rather than a comma (,) in there.
  2. You forgot to close main(). Add a closing curly brace (}) just before the last line, and I think your code will work!

#3

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