我试图在以下网站上创建效果:http://www.cssplay.co.uk/menu/css3-animation.html#x。我的代码目前只使用两个图像,但我将使用大约10到15作为最终动画。我试图实现悬停查看动画,第二个图像,而不是点击效果。下面的代码:悬停以查看与CSS链接的动画
.footer nav ul.homeandlist li {
display: block;
width: 40%;
height: 150px;
float: left;
margin: 1% 3%;
background-color: rgba(255, 165, 0, 0.11);
}
.footer nav ul.homeandlist a {
margin: 0;
padding: auto;
width: 100%;
height: 90px;
text-indent: -9000px;
line-height: 2em;
font-size: 16px;
display: block;
}
.footer nav ul.homeandlist .GetOnList {
position: relative;
width: 40%;
height: 150px;
}
.footer nav ul.homeandlist .GetOnList a {
display: block;
-webkit-transition: z-index 0.1s linear;
transtion: z-index 0.1s linear;
}
.footer nav ul.homeandlist .GetOnList a#a1 {
background: url('images/image1.png');
}
.footer nav ul.homeandlist .GetOnList a#a2 {
background: url('images/image2.png');
}
.footer nav ul.homeandlist .hover a:hover {
z-index: 20;
}
.footer nav ul.homeandlist .hover a:hover + a {
z-index: 30;
}
.footer nav ul.homeandlist .hover a#a1 {
z-index: 20;
}
.footer nav ul.homeandlist .hover a#a2 {
z-index: 10;
}
<div class="footer">
<nav>
<p class="footertext">Text will go here</p>
<div class="clear"></div>
<ul class="homeandlist">
<li class="GetOnList hover">
<a id="a1" href="GetOnList.html">Get On List</a>
<a id="a2" href="GetOnList.html">Get On List</a>
</li>
<li class="HomeLink"><a href="index.html" title="HomeLink">HomeLink</a>
</li>
</ul>
</nav>
</div>
到目前为止,只有图像1显示了,但没有任何反应悬停。对我来说,看起来我使用的是与网站上使用的代码相同的代码。有任何想法吗?
我编辑了代码,删除可能无关紧要的部分。如果需要更多代码,请告诉我,我可以包含您需要的内容,但这应该涵盖它。
你应该把仅有的事项代码。 – 2014-10-01 02:56:58