Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Home
Contact
Profile
About
请点击左上角图标查看效果
css
* { box-sizing: border-box; } html, body { height: 100vh; width: 100%; } body { margin: 0; padding: 0; background-image: radial-gradient(circle 248px at center, #16d9e3 0%, #30c7ec 47%, #46aef7 100%); } nav { overflow: hidden; position: relative; transform: translateX(-300px); height: 100%; width: 400px; transition: all 800ms cubic-bezier(.8, 0, .33, 1); border-radius: 0% 0% 100% 50%; } nav.nav-open { transform: translateX(0px); border-radius: 0% 0% 0% 0%; background: rgba(255, 255, 255, 0.6); } nav .menu-btn { position: absolute; top: 10%; right: 5%; padding: 0; width: 30px; cursor: pointer; z-index: 2; } nav .menu-btn .line { padding: 0; width: 30px; background: #fff; height: 2px; margin: 5px 0; transition: all 700ms cubic-bezier(.9, 0, .33, 1); } nav .menu-btn .line.line--1 { width: 30px; transform: rotate(0) translateY(0); } nav .menu-btn .line.line--1.line-cross { width: 30px; transform: rotate(45deg) translateY(10px); background: rgba(0,0,0,0.6); } nav .menu-btn .line.line--2 { width: 28px; transform: translateX(0); } nav .menu-btn .line.line--2.line-fade-out { width: 28px; transform: translate(30px); opacity: 0; } nav .menu-btn .line.line--3 { width: 20px; transform: rotate(0) translateY(0); } nav .menu-btn .line.line--3.line-cross { width: 30px; transform: rotate(-45deg) translateY(-10px); background: rgba(0,0,0,0.6); } nav .nav-links { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: translateX(-100px); opacity: 0; transition: all 900ms cubic-bezier(.9, 0, .33, 1); } nav .nav-links.fade-in { opacity: 1; transform: translateX(0px); } nav .nav-links .link { margin: 20px 0; text-decoration: none; font-family: sans-serif; color: rgba(0,0,0,0.9); font-weight: 700; text-transform: uppercase; font-size: 1.2rem; transition: all 300ms cubic-bezier(.9, 0, .33, 1); } nav .nav-links .link:hover { color: rgba(0, 0, 0, .5); } .inform{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255, 255, 255, 0.8); font-size: 2rem; font-family: sans-serif; text-transform: uppercase; letter-spacing: 5px; text-shadow: 0 0 20px rgba(0,0,0,0.6); } a{ margin: 0 20px; color: #fff; font-size: 2rem; transition: all 400ms ease; } a:hover{ color: #222; }
JavaScript
var menuBtn = document.querySelector('.menu-btn'); var nav = document.querySelector('nav'); var lineOne = document.querySelector('nav .menu-btn .line--1'); var lineTwo = document.querySelector('nav .menu-btn .line--2'); var lineThree = document.querySelector('nav .menu-btn .line--3'); var link = document.querySelector('nav .nav-links'); menuBtn.addEventListener('click', () => { nav.classList.toggle('nav-open'); lineOne.classList.toggle('line-cross'); lineTwo.classList.toggle('line-fade-out'); lineThree.classList.toggle('line-cross'); link.classList.toggle('fade-in'); })
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>滑动菜单-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号