JQuery SlideToggle () Doesn't work in FireFox, works in Chrome

My code is:

jQuery('.cart-module .cart-heading').bind('click', function() {
    if (jQuery(this).hasClass('active')) {
        jQuery(this).removeClass('active');
    } else {
        jQuery(this).addClass('active');
    }

    jQuery(this).parent().find('.cart-content').slideToggle('slow');
});
//--></script> 

You can test it yourself by quickly adding the product to your basket, like this https://muddydogcoffee.com/teas/176-organic-crimson-berry-fruit-tisane?device=iphone , and go to the basket here https: // muddydogcoffee.com/shopping-cart .

When you click Estimate Shipping and Taxes, it should display a DIV below it. However, it only works in Chrome, not Firefox. What can I do to fix this?

Thank.

+5
source share
3 answers

I had the same problem before, I did not quite understand why this was happening, but I found a workaround for it.

, , : : none html.

- , .

+3

event.preventDefault(); event.stopPropagation();, , Firefox. . :

jQuery('.cart-module .cart-heading').bind('click', function(e) {
    e.preventDefault();
    e.stopPropagation();
    if (jQuery(this).hasClass('active')) {
        jQuery(this).removeClass('active');
    } else {
        jQuery(this).addClass('active');
    }
 jQuery(this).parent().find('.cart-content').slideToggle('slow');
});
+2

You tried:

$(document).ready(function() {
   // put all your jQuery goodness in here.
 });
0
source

All Articles