jQuery SlideToggle()不适用于FireFox,适用于Chrome [英] jQuery SlideToggle() Not Working in FireFox, Works in Chrome

查看:359
本文介绍了jQuery SlideToggle()不适用于FireFox,适用于Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是这样的:

  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>

您可以通过快速添加产品到您的购物车来自己测试https://muddydogcoffee.com/teas/176-organic-crimson-berry-fruit-tisane?device = iphone ,然后在这里 https://muddydogcoffee.com/shopping-cart



当您点击估价运费&税款时,应在其下方显示DIV。但是,它只适用于Chrome,不适用于Firefox。我可以做些什么来解决这个问题?



谢谢。

解决方案

我以前也有同样的问题,但我并没有真正理解为什么会发生这种情况,但是我找到了解决办法。

我不确定它是否也适用于您,但我所做的是删除样式表中的display:none,并将其添加到html中。 / p>

如果有人可以解释这个奇怪的行为,那么这真的很有帮助。


My code is this:

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 for yourself by quickly adding a product to your cart like this https://muddydogcoffee.com/teas/176-organic-crimson-berry-fruit-tisane?device=iphone and going to the shopping cart here https://muddydogcoffee.com/shopping-cart.

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

Thanks.

解决方案

I had the same problem before, I haven't really understood why it happens but I found a workaround for it.

I am not sure if it will also work for you but what I did is I removed the display:none in the stylesheet and just added it inline in the html.

If anyone could explain the strange behavior it will really be helpful though.

这篇关于jQuery SlideToggle()不适用于FireFox,适用于Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆