title: Show/hide jquery plugin - my previous div stays open
body: <p>I´m using this jquery Show/hide plugin <a href="http://papermashup.com/jquery-show-hide-plugin/" rel="nofollow">http://papermashup.com/jquery-show-hide-plugin/</a></p>
  
  <p>I intend to close previous div <strong>on click any link</strong> on my page, but as I click on a new link my previous div stays open.</p>
  
  <p>My html</p>
  
  <pre><code>&lt;div id="slidingDiv_2" class"toggleDiv"&gt;&lt;!-- Conteúdo do menu 1 --&gt;
        &lt;div class="opmenu"&gt;
        &lt;table&gt;
        &lt;tr&gt;
          &lt;td&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#!"&gt;CENTROS DE ACTIVIDADES NOS TEMPOS LIVRES&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#!"&gt;SERVI&amp;Ccedil;O DE ATENDIMENTO E ACOMPANHAMENTO SOCIAL&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#!"&gt;CENTRO COMUNIT&amp;Aacute;RIO&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#!"&gt;APARTAMENTO PARA A AUTONOMIA DE VIDA&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>my link:</p>
  
  <pre><code>&lt;li class="items_menu"&gt;&lt;a href="#" class="show_hide" rel="#slidingDiv"&gt;A INSTITUIÇÃO&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>my js:</p>
  
  <pre><code>(function ($) {
      $.fn.showHide = function (options) {
  
          //default vars for the plugin
          var defaults = {
              speed: 1000,
              easing: 'easeInQuart',
              changeText: 0,
              showText: 'Mostrar',
              hideText: 'Ocultar'
  
          };
          var options = $.extend(defaults, options);
  
          $(this).click(function () { 
  
               $('.toggleDiv').slideUp(options.speed, options.easing);    
               // this var stores which button you've clicked
               var toggleClick = $(this);
               // this reads the rel attribute of the button to determine which div id to toggle
               var toggleDiv = $(this).attr('rel');
               // here we toggle show/hide the correct div at the right speed and using which easing effect
               $(toggleDiv).slideToggle(options.speed, options.easing, function() {
               // this only fires once the animation is completed
               if(options.changeText==1){
               $(toggleDiv).is(":visible") ? toggleClick.text(options.hideText) : toggleClick.text(options.showText);
               }
                });
  
            return false;
  
          });
  
      };
  })(jQuery);
  </code></pre>