我有this代码:
HTML
<a href="/link/" id="camereRichiedi">Go</a>
<div id="camereInformazioni">
<div id="richiediInfo" class="richiedi_info">
<div class="label">
Name
</div>
<div class="field">
<input type="text" name="field_name">
</div>
<div class="label">
Surname
</div>
<div class="field">
<input type="text" name="field_surname">
</div>
</div>
</div>
JQUERY
$('#camereRichiedi').click(function(e) {
e.preventDefault();
$('#richiediInfo').slideToggle('slow');
});
CSS
.richiedi_info
{
position:relative;
width:470px;
display:none;
}
.richiedi_info .label
{
width:80px;
float:left;
height:34px;
font-style:italic;
}
.richiedi_info .field
{
width:360px;
float:left;
height:34px;
}
因此,如果我点击 Go,在所有浏览器(Chrome、firefox、IE8+,期待 IE7)上,我会在输入字段(姓名和姓氏)附近看到“标签”。
在 IE7 上,只有从 .richiedi_info .label
CSS 类中删除 font-style:italic;
才能看到它们。
jQuery 的错误?或者我哪里错了?
最佳答案
有一个 known bug在影响斜体文本呈现的 IE7 中。它似乎与您的问题不完全匹配,但我敢打赌它是相关的。
根据一般经验,当 IE* 开始调皮时,我做的第一件事就是将 zoom: 1;
放在包含元素上;这迫使它“有布局”并经常解决问题。这是 some more info on "having layout" in IE .
关于jquery - 如果字体样式为斜体,IE7 在 slideToggle 上失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8213820/