以前我们要做个菜单的动画效果,免不了要使用JavaScript,今天我们只用css来实现一个鼠标经过放大圆并显示菜单的动画效果。
<html> <head> <meta charset="UTF-8"> <link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png"> <meta name="apple-mobile-web-app-title" content="CodePen"> <link rel="shortcut icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico"> <link rel="mask-icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg" color="#111"> <title>css鼠标经过放大圆并显示菜单动画www.woaidaogu.com</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> body, html { width: 100%; height: 100%; display: flex; background: #303f9f; } .g-container { position: relative; width: 400px; height: 300px; margin: auto; overflow: hidden; cursor: pointer; transition: -webkit-clip-path 0.3s linear; transition: clip-path 0.3s linear; transition: clip-path 0.3s linear, -webkit-clip-path 0.3s linear; -webkit-clip-path: circle(20px at 44px 44px); clip-path: circle(20px at 44px 44px); background: #fff; } .g-container:hover { -webkit-clip-path: circle(460px at 44px 44px); clip-path: circle(460px at 44px 44px); } ul { position: absolute; top: 100px; line-height: 32px; padding-left: 50px; font-size: 18px; } ul li:hover { color: deeppink; } </style> <script> window.console = window.console || function (t) { }; </script> <script> if (document.location.search.match(/type=embed/gi)) { window.parent.postMessage("resize", "*"); } </script> </head> <body translate="no"> <div> <ul> <li>关于我们</li> <li>产品介绍</li> <li>经典案例</li> <li>联系我们</li> </ul> </div> <div id="xl_chrome_ext_{4DB361DE-01F7-4376-B494-639E489D19ED}" style="display: none;"> <div></div> <a id="xl_chrome_ext_download" href="javascript:;">下载视频</a> <a id="xl_chrome_ext_close" href="javascript:;"></a> </div> </body> </html>
通过以上内容我们知道了css如何实现鼠标经过放大圆并显示菜单动画?感谢您访问“我爱捣鼓(www.woaidaogu.com)”网站的内容,希望对大家有所帮助!引用本文内容时,请注明出处!谢谢合作!