【发布时间】:2012-09-17 17:07:38
【问题描述】:
这在 FF 和 IE9 上运行良好,但在 IE7 和 8 上失败。
我有两个隐藏的 div,其中包含一个表单。单击按钮后,带有表单的正确 div 将显示在下面。所有这些都可以正常工作,但在 IE7 和 8 中,页脚将与表单重叠,并且不会被切换事件下推。
这是我的 html(精简版):
<div class="row" id="contactesp">
<div class="twelve columns">
<!-- Contact Form 7 plugin shows the form here -->
</div>
</div>
<div class="row" id="contactmund">
<div class="twelve columns">
<!-- Contact Form 7 plugin shows the form here -->
</div>
</div>
<!-- Footer -->
<footer role="contentinfo" id="content-info">
<div class="row">Content here</div>
</footer>
我的 CSS(其中一些):
#content-info {
background-color: #1C3F94;
clear: both;
color: #FFFFFF;
float: none;
margin: 20px -20px 0;
padding: 0 4%;
display:block;
}
#contactesp, #contactmund {
display: none;
height: auto;
overflow: hidden;
}
我还在表单中添加了溢出:隐藏但无济于事。 这是我的 JQuery:
jQuery(document).ready(function ($) {
$('.enesp').on('click',function(){
$('#contactmund').hide();
$('#contactesp').toggle();
});
$('.enmund').on('click',function(){
$('#contactesp').hide();
$('#contactmund').toggle();
});
});
该站点在此处获取完整代码:http://www.institutoespanol.net/contacto/,当您单击地图框中的任一按钮时,问题就会出现。
【问题讨论】:
-
从 #content-info 中移除 clear:both 和 float:none
-
@SACHIN 你应该在这里讨论而不是要求他发送代码或更好的jsfiddle
-
是的,我知道,但是当我检查 ie webdeveloper 工具并删除浮动并清除时,它在我的系统中工作正常
-
也许这个链接可以帮助你反思stackoverflow.com/questions/5227331/…这个脚本为Internet Explorer创建了html5的缺失元素,比如页脚。
-
@CharlesJourdan 我已经在网站上使用它了