title: Open foundation zurb dropdown programmatically
body: <p>I'm building a shopping-cart with the foundation dropdown so i need a way to open the dropdown programmatically.
  Is there any way?</p>
  
  <p>I tried this:</p>
  
  <pre><code>$(document).foundation('dropdown', 'open', ($('#top-bar-cart'), $('.top-bar-cart-link'));
  </code></pre>
  
  <p>this:</p>
  
  <pre><code>Foundation.libs.dropdown.open($('#top-bar-cart'), $('.top-bar-cart-link'));
  </code></pre>
  
  <p>And this: </p>
  
  <pre><code>$('.dropdown-btn').trigger('click');
  </code></pre>
  
  <p>But no succes so far.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I think I found the problem.
  I was using the code inside a click event to test it so I needed this:</p>
  
  <pre><code>e.stopImmediatePropagation();
  </code></pre>
  
  <p>to make it work.
  Full example: </p>
  
  <pre><code>$('#button').click(function(e) {
    e.preventDefault();
    e.stopImmediatePropagation();
  
    // use this (most correct way, I think)
    Foundation.libs.dropdown.open($('#top-bar-cart'), $('.top-bar-cart-link'));
    // or this
    //('.top-bar-cart-link').trigger('click');
  });
  </code></pre>
  
  <p>Thanks for the comments!</p>