title: Why my custom class is not applied to body when adding it through jQuery with gmap event click listener?
body: <p>I want to open a slide menu when clicking a gmap marker, but I can't. Here is how I proceeded to achieve that:</p>
  
  <pre><code>google.maps.event.addListener(marker, 'click', function () {  
      $('body').toggleClass("side-panel-open");
      if( $('body').hasClass('device-touch') ) {
         $('body').toggleClass("ohidden");
      }
      return false;
  });
  </code></pre>
  
  <p>The same thing is working well with a normal button, when I manage that this way:</p>
  
  <pre><code>$("#test").click(function(){
      $('body').toggleClass("side-panel-open");
      if( $('body').hasClass('device-touch') ) {
          $('body').toggleClass("ohidden");
      }
      return false;
  });
  </code></pre>
  
  <p>As you can see there:</p>
  
  <p><a href="http://www.themes.krown.ch/canvas4/HTML/index-fullscreen-image_test.html" rel="nofollow">http://www.themes.krown.ch/canvas4/HTML/index-fullscreen-image_test.html</a></p>
  
  <p>The "TEST" button on the footer, is working perfectly. Unfortunately, when clicking the gmap marker, nothing happens. I can see on Firebug that something happens on body, but the class "side-panel-open" doesn't stay. </p>
  
  <p>I also tried to just add a class to the body, this way:</p>
  
  <pre><code>$('body').addClass('side-panel-open');
  </code></pre>
  
  <p>Nothing happens as with the first code. This is so strange because if I try to add another class, for exemple "class_name". This class will be applied as expected to the body:</p>
  
  <pre><code>$('body').addClass('class_name');
  </code></pre>
  
  <p>Documentation:
  <a href="https://developers.google.com/maps/documentation/javascript/examples/event-simple" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/event-simple</a></p>