Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try removing the propagation on the button itself like so:</p> <pre><code>$('.dropdown-menu a.removefromcart').click(function(e) { e.stopPropagation(); }); </code></pre> <p><strong>Edit</strong></p> <p>Here is a demo from the comments with the solution above:</p> <p><a href="http://jsfiddle.net/andresilich/E9mpu/">http://jsfiddle.net/andresilich/E9mpu/</a></p> <p>Relevant code:</p> <p><strong>JS</strong></p> <pre><code>$(".removefromcart").on("click", function(e){ var fadeDelete = $(this).parents('.product'); $(fadeDelete).fadeOut(function() { $(this).remove(); }); e.stopPropagation(); }); </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;div id="shoppingcart" class="nav-collapse cart-collapse"&gt; &lt;ul class="nav pull-right"&gt; &lt;li class="dropdown open"&gt; &lt;a href="#" data-toggle="dropdown" class="dropdown-toggle"&gt;Totaal: &amp;acirc;&amp;sbquo;&amp;not; 43,00&lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li class="nav-header"&gt;Pakketten&lt;/li&gt; &lt;li class="product"&gt; &lt;span class="product-remove"&gt;&lt;a class="removefromcart" packageid="2" href="#"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="product-name"&gt;Test Product &lt;/span&gt; &lt;span class="quantity"&gt;&lt;span class="badge badge-inverse"&gt;1&lt;/span&gt;&lt;/span&gt; &lt;/li&gt; &lt;li class="product"&gt; &lt;span class="product-remove"&gt;&lt;a class="removefromcart" packageid="2" href="#"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="product-name"&gt;Test Product &lt;/span&gt; &lt;span class="quantity"&gt;&lt;span class="badge badge-inverse"&gt;10&lt;/span&gt;&lt;/span&gt; &lt;/li&gt; &lt;li class="product"&gt; &lt;span class="product-remove"&gt;&lt;a class="removefromcart" packageid="2" href="#"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="product-name"&gt;Test Product &lt;/span&gt; &lt;span class="quantity"&gt;&lt;span class="badge badge-inverse"&gt;8&lt;/span&gt;&lt;/span&gt; &lt;/li&gt; &lt;li class="product"&gt; &lt;span class="product-remove"&gt;&lt;a class="removefromcart" packageid="2" href="#"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="product-name"&gt;Test Product &lt;/span&gt; &lt;span class="quantity"&gt;&lt;span class="badge badge-inverse"&gt;3&lt;/span&gt;&lt;/span&gt; &lt;/li&gt; &lt;li class="product"&gt; &lt;span class="product-remove"&gt;&lt;a class="removefromcart" packageid="2" href="#"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt; &lt;span class="product-name"&gt;Test Product &lt;/span&gt; &lt;span class="quantity"&gt;&lt;span class="badge badge-inverse"&gt;4&lt;/span&gt;&lt;/span&gt; &lt;/li&gt; &lt;li class="divider"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Total: &amp;euro; 43,00&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/checkout"&gt;Checkout&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload