CSS3扇形動畫菜單

來源:互聯網
上載者:User
CSS3扇形動畫菜單外掛程式源碼,可以直接修改之前放在自己的項目中,對 CSS3有興趣的同學還可以,研究一下,來提高同學們 CSS3的知識。

代碼:

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>topic.alibabacloud.com--CSS3扇形動畫菜單</title><style>*{padding: 0; margin: 0;}body{background:#b1b1b1;margin:0px;padding:0px;font-size:14px;color:#000;}.menuHolder {width:100px; height:100px; margin:0 0 250px 0; position:relative;z-index:100;}.menuHolder ul {padding:0px; margin:0; list-style:none; position:absolute; left:0; top:0; width:0; height:0;}/*.menuHolder ul li {border-radius:0 0 300px 0; width:0; height:0;}*/.menuHolder ul li a {color:#000; text-decoration:none; font:bold 13px/30px arial, sans-serif; text-align:center; box-shadow:-5px 5px 5px rgba(0,0,0,0.4);transform-origin:0 0;}.menuHolder ul.p1 li {position:absolute; left:0; top:0;}.menuHolder ul.p2 {z-index:-1;}.menuHolder ul.p3 {z-index:-1;}/*畫第一個圓圈*/.menuHolder li.s1 > a {position:absolute; display:block; width:100px; height:100px; background:#c8c8c8; border-radius:0 0 100px 0;}/*畫第二個圓圈*/.menuHolder li.s2 > a {position:absolute; display:block; width:100px; padding-left:100px; height:200px; background:#ddd; border-radius:0 0 200px 0;}/*畫第三個圓圈*/.menuHolder ul.p3 li a {position:absolute; display:block; width:100px; padding-left:200px; height:300px; background:#999; border-radius:0 0 300px 0;}/*把第二第三個圓隱藏到角落裡去,讓視角看不到*/.menuHolder ul ul {transform-origin:0 0;transform:rotate(90deg);transition:1s;}/*繪製第二層的菜單*/.menuHolder li.s2:nth-of-type(6) > a {background:#888;transform:rotate(75deg);}.menuHolder li.s2:nth-of-type(5) > a {background:#999;transform:rotate(60deg);}.menuHolder li.s2:nth-of-type(4) > a {background:#aaa;transform:rotate(45deg);}.menuHolder li.s2:nth-of-type(3) > a {background:#bbb;transform:rotate(30deg);}.menuHolder li.s2:nth-of-type(2) > a {background:#ccc;transform:rotate(15deg);}.menuHolder .a6 li:nth-of-type(6) > a {background:#444;transform:rotate(75deg);}.menuHolder .a6 li:nth-of-type(5) > a {background:#555;transform:rotate(60deg);}.menuHolder .a6 li:nth-of-type(4) > a {background:#666;transform:rotate(45deg);}.menuHolder .a6 li:nth-of-type(3) > a {background:#777;transform:rotate(30deg);}.menuHolder .a6 li:nth-of-type(2) > a {background:#888;transform:rotate(15deg);}.menuHolder .a5 li:nth-of-type(5) > a {background:#555;transform:rotate(72deg);}.menuHolder .a5 li:nth-of-type(4) > a {background:#666;transform:rotate(54deg);}.menuHolder .a5 li:nth-of-type(3) > a {background:#777;transform:rotate(36deg);}.menuHolder .a5 li:nth-of-type(2) > a {background:#888;transform:rotate(18deg);}.menuHolder .a3 li:nth-of-type(3) > a {background:#777;transform:rotate(60deg);}.menuHolder .a3 li:nth-of-type(2) > a {background:#888;transform:rotate(30deg);}/*滑鼠滑過第一層菜單展開第二層菜單*/.menuHolder li.s1:hover ul.p2 {transform:rotate(0deg);}/*滑鼠滑過第二層菜單展開第三層菜單*/.menuHolder li.s2:hover ul.p3 {transform:rotate(0deg);}/*滑鼠滑過改變背景顏色和文字顏色*/.menuHolder ul li:hover > a {background:#f00; color:#fff;}.menuHolder li.s2:hover > a {background:#d00; color:#fff;}.menuHolder .a6 li:hover > a {background:#b00; color:#fff;}.menuHolder .a5 li:hover > a {background:#b00; color:#fff;}.menuHolder .a3 li:hover > a {background:#b00; color:#fff;}</style></head><body><div class="menuHolder"><div class="menuWindow"><ul class="p1"><li class="s1"><a href="#url">topic.alibabacloud.com</a><ul class="p2"><li class="s2"><a href="#"><span>首頁</span></a></li><li class="s2"><a href="#url"><span>視頻教程</span></a><ul class="p3 a3"><li><a href="#">PHP</a></li><li><a href="#">HTML</a></li><li><a href="#">CSS</a></li></ul></li><li class="s2"><a href="#url"><span>社區問答</span></a><ul class="p3 a6"><li><a href="#">PHP討論小組</a></li><li><a href="#">HTML討論小組</a></li><li><a href="#">css討論小組</a></li><li><a href="#">mysql討論小組</a></li><li><a href="#">js討論小組</a></li><li><a href="#">jquery討論小組</a></li></ul></li><li class="s2"><a href="#url"><span>技術文章</span></a><ul class="p3 a3"><li><a href="#">PHP頭條</a></li><li><a href="#">PHP教程</a></li><li><a href="#">mysql教程</a></li></ul></li><li class="s2"><a href="#url"><span>手冊下載</span></a><ul class="p3 a3"><li><a href="#">PHP手冊</a></li><li><a href="#">jquery手冊</a></li><li><a href="#">css手冊</a></li></ul></li><li class="s2 b6"><a href="#url"><span>工具下載</span></a><ul class="p3 a5"><li><a href="#">sublime下載</a></li><li><a href="#">PHP工具箱完整版下載</a></li><li><a href="#">PHPstorm下載</a></li><li><a href="#">Notepad++ 下載</a></li><li><a href="#">PHPstudy下載</a></li></ul></li></ul></li></ul></div></div></body></html>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.