How to hide Twitter Bootstrap dropdown

后端 未结 24 2288
悲&欢浪女
悲&欢浪女 2020-12-13 03:37

This is getting annoying — when I click on an item in a Bootstrap dropdown, the dropdown doesn\'t close. I have it set up to open a Facebox lightbox when you click the dropd

24条回答
  •  天命终不由人
    2020-12-13 03:43

    you can use this code in your current event handler

    $('.in,.open').removeClass('in open');
    

    in my scenario I used when ajax call complete

    jQuery(document).on('click', ".woocommerce-mini-cart__buttons .wc-forward.checkout", function() {
        var _this = jQuery(this);
        ajax_call(_this.attr("data-ajax-href"), "checkout-detail");
        $('.in,.open').removeClass('in open');
        return false;
    });
    

提交回复
热议问题