jquery ie8悬停问题– 动画/颜色不适用于过滤器旋转元素
http://www.the900number.com/news
在 ie8 中,当您将鼠标悬停在导航项上,然后将鼠标从其上移开 - 与当您实际将鼠标悬停在该项上时触发悬停状态相反。
它在 IE7 中运行得很好,所以我不确定 IE8 出了什么问题以及它如何查看盒子模型。非常感谢任何见解!
Jquery:
//Nav hover
$('#nav li:not(.current)').hover(function() {
var bgColor = $(this).css('color');
$(this).animate({
backgroundColor: bgColor,
marginRight: '10px'
}, 200);
}, function() {
$(this).animate({
backgroundColor: '#000',
marginRight: '0px'
}, 200);
});
CSS:
#nav {
width: 180px;
position: absolute;
left: 25px;
top: 14px;
z-index: 100000;
line-height: 26px;
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
#nav li {
float: right;
list-style: none;
display: block;
height: 29px;
padding: 2px 0px 0 0px;
background: black;
margin-bottom: 2px;
}
#nav li a {
position: relative;
left: 9px;
display: block;
color: #fff;
font-size: 16px;
letter-spacing: 1px;
font-family: "bigNoodle","refrigerator-deluxe-1", "refrigerator-deluxe-2", "helvetica neue", helvetica, arial;
text-decoration: none !important;
text-transform: uppercase;
cursor: pointer;
}
有什么想法吗?
谢谢!
http://www.the900number.com/news
In ie8 the hover state for the nav happens when you mouse over a nav item and then mouse off of it– As opposed to hover state firing when you actually put the mouse over the item.
It works great in IE7 so I'm not sure what's wrong with IE8 and how it's viewing the box model. Any insight is very much appreciated!
Jquery:
//Nav hover
$('#nav li:not(.current)').hover(function() {
var bgColor = $(this).css('color');
$(this).animate({
backgroundColor: bgColor,
marginRight: '10px'
}, 200);
}, function() {
$(this).animate({
backgroundColor: '#000',
marginRight: '0px'
}, 200);
});
CSS:
#nav {
width: 180px;
position: absolute;
left: 25px;
top: 14px;
z-index: 100000;
line-height: 26px;
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
#nav li {
float: right;
list-style: none;
display: block;
height: 29px;
padding: 2px 0px 0 0px;
background: black;
margin-bottom: 2px;
}
#nav li a {
position: relative;
left: 9px;
display: block;
color: #fff;
font-size: 16px;
letter-spacing: 1px;
font-family: "bigNoodle","refrigerator-deluxe-1", "refrigerator-deluxe-2", "helvetica neue", helvetica, arial;
text-decoration: none !important;
text-transform: uppercase;
cursor: pointer;
}
Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道为什么这有效,但它确实有效。添加行“opacity: 1.0”使动画在 ie8 中工作。与组合 microsoft css 过滤器有关。
I don't know why this worked, but it did. Adding the line "opacity: 1.0" made the animation work in ie8. Something to do with combining microsoft css filters.