Javascript css悬停大小转换效果需要跨浏览器/回退解决方案
我有一个相当简单的css3标记,它显示了一点很酷的悬停效果。我需要一个Internet Explorer 10之前的备份。我也不能让它看起来100%正确,但代码如下: HTML 工作演示点击 我的标记中唯一的一点就是css3是Javascript css悬停大小转换效果需要跨浏览器/回退解决方案,javascript,html,css,Javascript,Html,Css,我有一个相当简单的css3标记,它显示了一点很酷的悬停效果。我需要一个Internet Explorer 10之前的备份。我也不能让它看起来100%正确,但代码如下: HTML 工作演示点击 我的标记中唯一的一点就是css3是转换效果,我觉得它们应该是旧浏览器的简单css2替代品。我以为是Javascript,但不确定是什么。有什么帮助吗?您可以使用jQuery UI设置类更改的动画。将:悬停选择器更改为。悬停并设置该转换的动画: $('.ca-menu a').hover(function()
转换
效果,我觉得它们应该是旧浏览器的简单css2替代品。我以为是Javascript,但不确定是什么。有什么帮助吗?您可以使用jQuery UI设置类更改的动画。将:悬停
选择器更改为。悬停
并设置该转换的动画:
$('.ca-menu a').hover(function() {
$(this).parent('li').switchClass('', 'hover');
}, function() {
$(this).parent('li').switchClass('hover', '');
});
.ca-menu{
padding: 0;
margin: 20px auto;
width: 500px;
}
.ca-menu li{
width: 500px;
height: 100px;
overflow: hidden;
display: block;
background: #fff;
box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
margin-bottom: 4px;
border-left: 10px solid #797979;
transition: all 300ms ease-in-out;
}
.ca-menu li:last-child{
margin-bottom: 0px;
}
.ca-menu li a{
text-align: left;
display: block;
width: 100%;
height: 100%;
color: #797979;
position:relative;
}
.ca-icon{
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
font-size: 20px;
text-shadow: 0px 0px 1px #797979;
line-height: 90px;
position: absolute;
width: 90px;
left: 20px;
text-align: center;
transition: all 300ms linear;
}
.ca-content{
position: absolute;
left: 120px;
width: 370px;
height: 30px;
top: 1px;
}
.ca-main{
font-size: 30px;
transition: all 300ms linear;
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
margin-bottom:-5px;
}
.ca-sub{
font-size: 14px;
color: #797979;
transition: all 300ms linear;
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
margin-top:-5px;
}
.ca-menu li:hover{
border-color: #57C5E0;
background: #797979;
}
.ca-menu li:hover .ca-icon{
color: #57C5E0;
text-shadow: 0px 0px 1px #57C5E0;
font-size: 50px;
}
.ca-menu li:hover .ca-main{
color: #57C5E0;
font-size: 14px;
}
.ca-menu li:hover .ca-sub{
color: #fff;
font-size: 30px;
}
$('.ca-menu a').hover(function() {
$(this).parent('li').switchClass('', 'hover');
}, function() {
$(this).parent('li').switchClass('hover', '');
});