Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Hover & Click Me
css
@import url("https://fonts.googleapis.com/css?family=Spartan&display=swap"); * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; } html, body { height: 100%; margin: 0; } body { display: flex; font-family: "Spartan", sans-serif; font-size: 14px; align-items: center; justify-content: center; background-color: #dd1166; } @keyframes scale-up { from { transform: scaleY(1) scaleX(1); opacity: 0.5; } to { transform: scaleX(1.3) scaleY(2); opacity: 0; } } .button { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px 36px; color: #ffffff; border-radius: 40px; background-color: #000000; cursor: pointer; user-select: none; } .button__text { position: relative; margin-right: 12px; transition: ease-in-out .18s; z-index: 2; } .button__icon { position: relative; transition: ease-in-out .18s; z-index: 2; } .button:before { content: ''; position: absolute; width: 100%; height: 100%; background-color: #ffffff; opacity: 0.5; border-radius: 40px; z-index: -1; } .button:after { content: ''; position: absolute; width: 100%; height: 100%; background-color: #ffffff; z-index: 1; transition: ease-in-out .18s; transform-origin: center left; transform: scaleX(0); border-radius: 40px; } .button:hover { color: #000000; } .button:hover:after { transform-origin: center right; transform: scaleX(1); color: #ffffff; } .button:hover .button__icon { transform: translate3d(400%, 0px, 0px); opacity: 0; } .button:hover .button__text { transform: translate3d(12px, 0px, 0px); } .button:active:hover { opacity: 0.8; transition: opacity ease-in-out .3s; } .button.active:before { animation: scale-up .3s ease; }
JavaScript
button = document.querySelector('.button'); button.addEventListener('mouseup', function(){ this.classList.add('active'); setTimeout(function () { button.classList.remove('active'); }, 300); });
粒子
时间
文字
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号