Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body { filter: url("#goo"); background-color: #03254c; background: linear-gradient(#03254c, black); } .menu-bar { position: relative; display: flex; background-color: #1167b1; background: linear-gradient(#02457a, #1167b1); box-shadow: 1px 1px 5px #21cdfc; max-width: max-content; margin: 45vh auto; border-radius: 20px; padding: 20px; } .menu-bar div { cursor: pointer; z-index: 1; padding-right: 40px; } .menu-bar div:last-of-type { padding-right: 0px; } .selected { position: absolute; width: 18px; height: 55px; border-radius: 50%; background-color: #d0efff; background: linear-gradient(#d0efff, #1167b1); z-index: 0; left: 14px; top: 17px; } .notification { animation: notification 1s; left: 100px; transition: left 1.5s; } .profile { animation: profile 1s; left: 182px; transition: left 1.5s; } .setting { animation: setting 1s; left: 268px; transition: left 1.5s; } .home { animation: home 1s; left: 15px; transition: left 1.5s; } @keyframes profile { 50% { top: -60px; } } @keyframes setting { 50% { top: -60px; } } @keyframes notification { 50% { top: -60px; } } @keyframes home { 50% { top: -60px; } }
JavaScript
const selected = document.getElementById("selected"); const notsvg = document.getElementById("notificationsvg").firstElementChild; const homesvg = document.getElementById("homesvg").firstElementChild; const settingsvg = document.getElementById("settingsvg").firstElementChild; const profilesvg = document.getElementById("profilesvg").firstElementChild; function notificationfn() { selected.classList.add("notification"); selected.classList.remove("setting"); selected.classList.remove("profile"); selected.classList.remove("home"); notsvg.style.fill = "#03254c"; homesvg.style.fill = "#d0efff"; settingsvg.style.fill = "#d0efff"; profilesvg.style.fill = "#d0efff"; var action = gsap.timeline(); action .to("#notificationsvg", { duration: 0.2, rotation: 10 }) .to("#notificationsvg", { duration: 0.2, rotation: -30 }) .to("#notificationsvg", { duration: 0.2, rotation: 30 }) .to("#notificationsvg", { duration: 0.2, rotation: 0 }); } function setting() { notsvg.style.fill = "#d0efff"; homesvg.style.fill = "#d0efff"; settingsvg.style.fill = "#03254c"; profilesvg.style.fill = "#d0efff"; var action = gsap.timeline(); action .to("#settingsvg", { duration: 0.4, rotation: 600 }) .to("#settingsvg", { duration: 0.4, rotation: 0 }); selected.classList.remove("notification"); selected.classList.add("setting"); selected.classList.remove("profile"); selected.classList.remove("home"); } function profile() { notsvg.style.fill = "#d0efff"; homesvg.style.fill = "#d0efff"; settingsvg.style.fill = "#d0efff"; profilesvg.style.fill = "#03254c"; var action = gsap.timeline(); action .to("#profilesvg", { duration: 0.4, y: -8 }) .to("#profilesvg", { duration: 0.4, y: 0 }); selected.classList.remove("notification"); selected.classList.remove("setting"); selected.classList.add("profile"); selected.classList.remove("home"); } function home() { notsvg.style.fill = "#d0efff"; homesvg.style.fill = "#03254c"; settingsvg.style.fill = "#d0efff"; profilesvg.style.fill = "#d0efff"; var action = gsap.timeline(); action .to("#homesvg", { duration: 0.4, x: 6 }) .to("#homesvg", { duration: 0.4, x: 0 }); selected.classList.remove("notification"); selected.classList.remove("setting"); selected.classList.remove("profile"); selected.classList.add("home"); }
粒子
时间
文字
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号