Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7892789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:57:20+00:00 2026-06-03T06:57:20+00:00

I use a bootstrap dropdown as a shoppingcart. In the shopping cart is a

  • 0

I use a bootstrap dropdown as a shoppingcart. In the shopping cart is a ‘remove product’ button (a link). If I click it, my shoppingcart script removes the product, but the menu fades away. Is there anyway way to prevent this? I tried e.startPropagation, but that didn’t seem to work:

<div id="shoppingcart" class="nav-collapse cart-collapse">
 <ul class="nav pull-right">
  <li class="dropdown open">
    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Totaal:
    &acirc;&sbquo;&not; 43,00</a>

    <ul class="dropdown-menu">
      <li class="nav-header">Pakketten</li>

      <li>
       <span class="quantity">1x</span>
       <span class="product-name">Test Product </span>
       <span class="product-remove"><a class="removefromcart" packageid="4" href="#">x</a>
        </span></li>

      <li><a href="#">Total: &euro; 43,00</a></li>

      <li><a href="/checkout">Checkout</a></li>
    </ul>
  </li>
</ul>

As you can see tha element with class=”dropwdown-toggle” made it a dropdown. Another idea was that I just reopen it on clicking programmatically. So if someone can explain me how to programmatically open a Bootstrap dropdown, it would help well!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:57:22+00:00Added an answer on June 3, 2026 at 6:57 am

    Try removing the propagation on the button itself like so:

    $('.dropdown-menu a.removefromcart').click(function(e) {
        e.stopPropagation();
    });
    

    Edit

    Here is a demo from the comments with the solution above:

    http://jsfiddle.net/andresilich/E9mpu/

    Relevant code:

    JS

    $(".removefromcart").on("click", function(e){
        var fadeDelete = $(this).parents('.product');
        $(fadeDelete).fadeOut(function() {
            $(this).remove();
        });
    
        e.stopPropagation();
    });
    

    HTML

    <div id="shoppingcart" class="nav-collapse cart-collapse">
     <ul class="nav pull-right">
      <li class="dropdown open">
        <a href="#" data-toggle="dropdown" class="dropdown-toggle">Totaal:
        &acirc;&sbquo;&not; 43,00</a>
    
        <ul class="dropdown-menu">
          <li class="nav-header">Pakketten</li>
            <li class="product">
                <span class="product-remove"><a class="removefromcart" packageid="2" href="#"><i class="icon-remove"></i></a></span>
                <span class="product-name">Test Product </span>
                <span class="quantity"><span class="badge badge-inverse">1</span></span>
            </li>
            <li class="product">
                <span class="product-remove"><a class="removefromcart" packageid="2" href="#"><i class="icon-remove"></i></a></span>
                <span class="product-name">Test Product </span>
                <span class="quantity"><span class="badge badge-inverse">10</span></span>
            </li>
            <li class="product">
                <span class="product-remove"><a class="removefromcart" packageid="2" href="#"><i class="icon-remove"></i></a></span>
                <span class="product-name">Test Product </span>
                <span class="quantity"><span class="badge badge-inverse">8</span></span>
            </li>
            <li class="product">
                <span class="product-remove"><a class="removefromcart" packageid="2" href="#"><i class="icon-remove"></i></a></span>
                <span class="product-name">Test Product </span>
                <span class="quantity"><span class="badge badge-inverse">3</span></span>
            </li>
            <li class="product">
                <span class="product-remove"><a class="removefromcart" packageid="2" href="#"><i class="icon-remove"></i></a></span>
                <span class="product-name">Test Product </span>
                <span class="quantity"><span class="badge badge-inverse">4</span></span>
            </li>
            <li class="divider"></li>
            <li><a href="#">Total: &euro; 43,00</a></li>
            <li><a href="/checkout">Checkout</a></li>
        </ul>
      </li>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Twitters bootstrap dropdown, but when I click on the dropdown
Trying to use Twitter Bootstrap's (2.0) Dropdown menu. But somewhy it adds additional empty
I'd like to use a Twitter Bootstrap dropdown button : <div class=btn-group> <button class=btn
I have a requirement where I HAVE TO use bootstrap autocomplete dropdown, BUT user
I'm trying to use Twitter Bootstrap's dropdown menu in its top nav bar. You
I have started to use frameworks like Twitter Bootstrap , but if Twitter releases
I'm trying to use bootstrap with the jquery validation plugin but when I try
I'm trying to use Twitter Bootstrap Twipsy as a hovering tooltip with a link
I am trying to use bootstrap to append the button inside of the search
I am trying to use Bootstrap forms in Rails. But after inspecting the _form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.