In the close menu this syntax error appear: Uncaught SyntaxError: Invalid shorthand property initializer


#1



https://www.codecademy.com/en/courses/web-beginner-en-zmn0b/0/7?content_from=make-an-interactive-website%3Ayour-first-program


Uncaught SyntaxError: Invalid shorthand property initializer


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


#2

Compare the above to, left: '0px'


#3

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