<nav>
<ul class="top-menu">
<li><a href=#>Home</a><div class="menu-item" id="home"></div></li>
<li><a href=#>Catalog</a><div class="menu-item" id="cataloge"></div></li>
<li><a href=#>Price</a><div class="menu-item" id="price"></div></li>
<li><a href=#>About</a><div class="menu-item" id="about"></div></li>
<li><a href=#>Contact</a><div class="menu-item" id="contact"></div></li>
</ul>
</nav>
nav {
width: 960px;
height: 100px;
margin: 120px auto;
text-align: center;
}
.top-menu li {
display: inline-block;
text-align: center;
margin: 30px 5px;
position: relative;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
}
.top-menu li:hover {
margin: 30px 20px;
}
.top-menu li:active {
margin: 30px 33px;
}
.top-menu li a {
width: 100px;
height: 100px;
z-index: 9999;
position: absolute;
top: 35px;
font-weight: bold;
display: block;
text-decoration: none;
font-size: 20px;
color: #fff;
text-shadow: 0px 1px 1px rgba(0,0,0,0.4), 0px 4px 6px rgba(0,0,0,0.1), 0px 9px 11px rgba(0,0,0,0.1);
-webkit-transition: all 0.1s linear;
-moz-transition: all 0.1s linear;
-o-transition: all 0.1s linear;
}
.top-menu li:active a {
font-size: 26px;
top: 30px;
text-shadow: none;
}
.top-menu li div.menu-item {
width: 100px;
height: 100px;
display: block;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-webkit-border-top-left-radius: 100px;
-webkit-border-bottom-right-radius: 100px;
-moz-border-radius-topleft: 100px;
-moz-border-radius-bottomright: 100px;
border-top-left-radius: 100px;
border-bottom-right-radius: 100px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
}
.top-menu li:hover div.menu-item{
-webkit-border-top-left-radius: 80px;
-webkit-border-bottom-right-radius: 80px;
-moz-border-radius-topleft: 80px;
-moz-border-radius-bottomright: 80px;
border-top-left-radius: 80px;
border-bottom-right-radius: 80px;
-webkit-transform: rotate(225deg);
-moz-transform: rotate(225deg);
-o-transform: rotate(225deg);
}
.top-menu li:active div.menu-item{
-webkit-border-top-left-radius: 50px;
-webkit-border-bottom-right-radius: 50px;
-moz-border-radius-topleft: 50px;
-moz-border-radius-bottomright: 50px;
border-top-left-radius: 50px;
border-bottom-right-radius: 50px;
}
#home { background: #41D05F; }
#cataloge { background: #E42B2B; }
#price { background: #ff8400; }
#about { background: #a800ff; }
#contact { background: #49a7f3; }
这非常巧妙,但我喜欢找bug,我确实发现了一个,如果你将鼠标悬停在叶子的边缘附近,过渡就会变得很疯狂,你会得到这种意想不到但很酷的3D扭曲效果。除此之外,它运行得非常好 :D
太棒了,伙计!我将在某处使用它!太赞了..用户会一直玩它!
这真的很棒,谢谢..Ahmad 是对的,用户会一直玩它..我玩了好多分钟!!
这篇有趣的文章。然后谢谢你……这让我非常清楚地理解了我的知识……
太棒了,伙计!!
我的屏幕在每次过渡结束时都会闪烁黑色。
还有其他人遇到这个问题吗?(Chrome 12.0.742.122)
是的。我还以为是我自己不由自主地眨眼睛呢。
我在任何网站上使用 Chrome 时,所有 CSS 过渡都会出现完全相同的问题。
非常酷!必须找到一个地方来使用它。
@Ben:使用完全相同的 Chrome 版本,我没有遇到你提到的闪烁问题。
这太酷了!
你好,
很棒的作品!过渡很酷,也很吸引眼球。但像往常一样(使用 IE),不同版本的 IE 存在问题。没有哪个版本的 IE 能正确显示菜单。在 IE8 和 IE7 中,你甚至无法获得对齐和过渡,不知何故它在 IE9 上可以工作,但存在错位。其他浏览器运行良好。
干得好 :) !!!
这真的很棒,很棒的作品! :)
这表明了 CSS3 的强大功能。很棒的作品。感谢分享。
我发现了一些不寻常的东西。只需点击那里的任何叶子,然后不要松开鼠标。
现在将鼠标从叶子上移开。
松开鼠标单击。
叶子和字体保持展开状态。
请尝试一下。
这真的很棒! :)
如何将其垂直化?我的菜单栏是垂直的……
如何更改形状?