Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
HOME
HOME
LIKES
LIKES
STATS
STATS
PICTURES
PICTURES
SHARE
SHARE
SETTINGS
SETTINGS
css
/* variables */ /* Reset */ *, *::after, *::before { margin: 0; padding: 0; box-sizing: border-box; } /* Generic */ body { display: flex; justify-content: center; align-items: center; width: 100%; height: 100vh; font-family: 'Poppins', sans-serif; font-size: 11px; letter-spacing: 1px; background: #F0EDFD; color: #FFFFFF; user-select: none; } /**/ .main { display: flex; flex-direction: column; width: 300px; height: auto; padding: 10px; background: #7B49DD; border-radius: 30px; box-shadow: 0 0 40px 5px rgba(123, 73, 221, 0.25); } .bar { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; width: 100%; height: 50px; padding: 10px 0px; margin-bottom: 10px; } .bar__icon { width: 40px; height: 40px; object-fit: contain; padding: 10px; background: #6b34d9; border-radius: 50%; } .menu { display: flex; flex-wrap: wrap; width: 100%; height: 420px; position: relative; } .menu__item { display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; width: 140px; height: 140px; cursor: pointer; background: transparent; z-index: 100; transition: 150ms; } .menu__item:hover .menu__icon { animation: icon .1s 4; } .menu__item:hover .menu__span { transform: translateY(-17px); transition: 300ms; } .menu__icon { width: 25px; height: 25px; object-fit: contain; margin: 2px; } .menu__content { display: flex; flex-direction: column; justify-content: flex-start; align-items: center; position: relative; width: 100%; height: 18px; overflow: hidden; } /**/ .is-active { position: absolute; top: 0; left: 0; width: 140px; height: 140px; background: #6b34d9; transition: 200ms; border-radius: 20px; } @keyframes icon { 0% { transform: rotateZ(-10deg); } 100% { transform: rotateZ(10deg); } }
JavaScript
/* Const */ const menuItem = document.querySelectorAll(".menu__item"); const currentItem = document.querySelector("#current"); const mov = 140; /* Func */ let getItem = (event) => { let x = event.currentTarget.id.slice("-")[0]; let y = event.currentTarget.id.slice("-")[2]; currentItem.style.left = `${ x * mov }px`; setTimeout( () => currentItem.style.top = `${ y * mov }px`, 200 ) ; } /* Main */ let mainFunction = (event) => { for (var i = 0; i < menuItem.length; i++) { menuItem[i].addEventListener("click", getItem); } } window.addEventListener("load", mainFunction);
粒子
时间
文字
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号