简体   繁体   English

jQuery-动画导致Div重叠IE7

[英]jQuery - Animation Causes Div Overlap IE7

I have a hidden div (#contactArea) above another div. 我在另一个div上方有一个隐藏的div(#contactArea)。 When I click the link, the #contactArea opens up. 当我单击链接时,#contactArea打开。 When I click it again, it closes back up. 当我再次单击它时,它将关闭。 It all works nicely, except in IE7. 除了IE7,其他所有功能都运行良好。

The two divs are transparent, so they overlap. 两个div是透明的,因此它们重叠。 I have no idea why this happens, or why doesn't it happen on other browsers. 我不知道为什么会这样,或者为什么不会在其他浏览器上发生。 It just about feels like IE7 is right on this one. 感觉就像IE7恰好在此之上。

Any way to fix this? 有任何解决这个问题的方法吗?

$(document).ready(function(){ 
    $("#contactArea").css('display', 'none');

    $("a.contact").toggle(function() { 
        $("#contactArea").animate({height: "show"}, 1500, "easeOutBounce");
    }, function() {
        $("#contactArea").animate({height: "hide"}, 1500, "easeOutBounce");
    });
});

Add the following CSS rule: 添加以下CSS规则:

#contactArea {
    background-color: white;
}

(Or some other color). (或其他颜色)。 You might also want to add a border. 您可能还需要添加边框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM