Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自定义可扩展jquery引导程序手风琴动画在chrome中中断/在ff中工作。_Jquery_Twitter Bootstrap_Jquery Animate - Fatal编程技术网

自定义可扩展jquery引导程序手风琴动画在chrome中中断/在ff中工作。

自定义可扩展jquery引导程序手风琴动画在chrome中中断/在ff中工作。,jquery,twitter-bootstrap,jquery-animate,Jquery,Twitter Bootstrap,Jquery Animate,问题 我一直在努力使我网站的这个手风琴部分能够跨浏览器兼容/响应。firefox上的这个演示中的可扩展手风琴的工作原理与它应该的一样: 但是,当你在chrome中尝试时,第二项向下的宽度计算不正确。我似乎无法理解为什么只有chrome才会出现这种情况 每个打开的手风琴我都有以下代码: $(document).ready(function(){ $('#collapse_link1').click(function() { if($('#collapse1').hasClass('i

问题

我一直在努力使我网站的这个手风琴部分能够跨浏览器兼容/响应。firefox上的这个演示中的可扩展手风琴的工作原理与它应该的一样:

但是,当你在chrome中尝试时,第二项向下的宽度计算不正确。我似乎无法理解为什么只有chrome才会出现这种情况

每个打开的手风琴我都有以下代码:

    $(document).ready(function(){
$('#collapse_link1').click(function() {
  if($('#collapse1').hasClass('in')){
    $('#collapse1').animate({ padding: 0 }).delay(100).removeClass('visible');
    }else{
        $('#collapse1').animate({ padding: "0px 20px 20px 20px" });
        setTimeout(function() {
            $('#collapse1').addClass('visible');
        }, 1);
    }
}); 
}))


任何想法都会有很大帮助,因为我学习jquery的速度非常快,但小错误往往会让我陷入困境!嘿!无论如何,希望您能提供帮助:)

无法查看您提供的链接,因为除了html之外,没有加载任何内容

考虑到你提供的东西,我很快就搞定了一些东西。让我知道这是否符合你的需求

    if($('#collapse1').hasClass('in')){

        $('#collapse1').stop(true, false).animate({ padding: 0 }).delay(100).removeClass('in');

    } else {

        $('#collapse1').stop(true, false).animate({ padding: "0px 20px 20px 20px" });
        setTimeout(function() {
            $('#collapse1').addClass('in');
        }, 1);

    }