title: Add class to current open infowindow
body: <p>I have a Google Map with a bunch of markers on it. I also have a corresponding sidebar that lists those markers. When you click one of them, its corresponding marker on the map opens the info window. This works perfectly.</p>
  
  <p>When you click one of these links in the sidebar I want to add a class of 'bounce' to it so it becomes visibly the active/open link. Likewise if I click a marker on the map I want the same class to get added to the list item. When another marker or link is clicked I'd like that class to be moved the most current clicked item.</p>
  
  <p>I have a jsFiddle of my map code here: <a href="http://jsfiddle.net/3xkuybrf/2/" rel="nofollow">http://jsfiddle.net/3xkuybrf/2/</a></p>
  
  <p>All my code does below is add a class to the first clicked link and doesn't do what I want. I want to add a class to the active/open link/marker and when another link/marker is clicked I want the class to be removed and added to the newest clicked item:</p>
  
  <pre><code>$(document).on('click', '#p'+index, function(){
          infowindow.open(map, marker);
          map.setCenter(marker.getPosition());
  
          if ($('#listdata li').hasClass('bounce')) {
              $(this).removeClass( "bounce" ); 
          } else {
              $(this).addClass( "bounce" );
          }
  
      });
  </code></pre>
  
  <p>What am I doing wrong?</p>