Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Cut
Copy
Paste
css
@import url("https://fonts.googleapis.com/css?family=Raleway:400,500,700&display=swap"); body { height: 100vh; margin: 0; display: grid; place-items: center; background-color: #5067EF } .multi-button { padding: 8px 10px; border-radius: 50px; background: #fff; border: 0.5px solid rgba(146, 152, 176, 0.4); box-shadow: 0 0 10px rgba(146, 152, 176, 0.2), 4px 4px 10px rgba(146, 152, 176, 0.2); cursor: default; } .multi-button button { border: 0 solid transparent; background: transparent; padding: 10px 30px; margin: 0 -2px; color: #273043; font-size: 17px; border-radius: 12px; cursor: pointer; position: relative; top: 0; left: 0; outline: none; transition: background 0.2s ease-in-out; } .multi-button button:first-child { border-top-left-radius: 40px; border-bottom-left-radius: 40px; } .multi-button button:last-child { border-top-right-radius: 40px; border-bottom-right-radius: 40px; } .multi-button button div { position: absolute; top: -43px; left: calc(50% - 40px); width: 80px; font-size: 13px; color: #fff; background: rgba(20, 25, 36, 0.7); border-radius: 16px; line-height: 30px; font-family: 'Raleway', Arial, sans-serif; text-align: center; font-weight: 500; letter-spacing: 1px; box-shadow: 0 0 5px rgba(39, 48, 68, 0.3), 1px 1px 5px rgba(39, 48, 68, 0.2); display: none; cursor: pointer; } .multi-button button:hover { background: #f0f1f4; } .multi-button button:hover div { display: block; animation: tooltip-animation-normal 0.3s ease-out forwards; } .multi-button button:hover div.animate-right { animation: tooltip-animation-right 0.3s ease-out forwards; } .multi-button button:hover div.animate-left { animation: tooltip-animation-left 0.3s ease-out forwards; } .multi-button button:active { outline: none; background: #d6d8e1; } @keyframes tooltip-animation-right { 0% { transform: translateX(-75px); } 100% { transform: translateX(0); } } @keyframes tooltip-animation-left { 0% { transform: translateX(75px); } 100% { transform: translateX(0); } } @keyframes tooltip-animation-normal { 0% { transform: translateY(-20px); } 100% { transform: translateY(0); } }
JavaScript
window.onload = () => { const buttons = document.querySelectorAll(".multi-button button"); buttons.forEach((button, index) => { button.addEventListener("mouseover", () => { if (index > 0) { const prevTooltip = buttons[index-1].querySelector("div"); prevTooltip.classList.remove("animate-right"); prevTooltip.classList.add("animate-left"); } if (index < buttons.length - 1) { const nextTooltip = buttons[index+1].querySelector("div"); nextTooltip.classList.remove("animate-left"); nextTooltip.classList.add("animate-right"); } }); }); }
粒子
时间
文字
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号