IE7上的保证金发行,jQuery悬停影响绝对头寸
将绝对位置设置为IE7上的保证金发行,jQuery悬停影响绝对头寸,jquery,css,css-position,Jquery,Css,Css Position,将绝对位置设置为.nav li p会在仅将图像悬停在IE7上时产生额外的边距,但如果没有绝对位置,图像会闪烁 除了绝对定位,还有其他选择吗 这就是我所拥有的: $('ul.nav li').hover(function() { $(this).prepend('<p></p>') .find('p') .fadeIn('fast'); }, function() { $(this).find('p') .fad
.nav li p
会在仅将图像悬停在IE7上时产生额外的边距,但如果没有绝对位置,图像会闪烁
除了绝对定位,还有其他选择吗
这就是我所拥有的:
$('ul.nav li').hover(function() {
$(this).prepend('<p></p>')
.find('p')
.fadeIn('fast');
}, function() {
$(this).find('p')
.fadeOut('fast', function() {
$(this).remove()
});
});
HTML:
我要尝试的第一件事始终是在相关元素中添加zoom:1。有时父母。。有时是孩子。zoom:1恰好将IE7放在了一起
你会惊讶地发现,这样做能奏效多少次 标记是相对于
.nav li{
width:360px;
}
.nav li p {
width:360px;
margin: 0;
padding:0;
position: absolute;
display:none;
}
li#stylea {height:138px;background: url(images/1.jpg) 0 -474px no-repeat}
li#stylea p {height:138px;background: url(images/1.jpg) 0 bottom no-repeat;}
li#styleb { height:149px; background: url(images/1.jpg) 0 -176px no-repeat}
li#styleb p {height:149px;background: url(images/1.jpg) 0 -325px no-repeat;}
<div>
<ul class="nav">
<li id="stylec"></li>
<li id="styleb"></li>
<li id="stylea"></li>
</ul>
<ul class="nav">
<li id="styled"></li>
<li id="stylee"></li>
<li id="stylef"></li>
</ul>
</div>