Using .slide on 2 separate elements.

Using .slide on 2 separate elements.

Hi All,

I'm using the code below to show and hide a div.

  1. jQuery(document).ready(function() {
  2. $('#blag-booking-drop-down').hide();
  3. $('#blag-booking').click(function(e){ 
  4.     e.stopPropagation();
  5.     $('#blag-booking-drop-down').slideToggle();
  6. });
  7. $('#blag-booking-drop-down').click(function(e){
  8.     e.stopPropagation();
  9. });
  10. $(document).click(function(){
  11.      $('#blag-booking-drop-down').slideUp();
  12. });
It's working great for one div. I've replicated the code for another div on the same page and it works fine except that both div are able to be shown at the same time. How can I make so that only one can be open at at time?

Many thanks.

N