css3按钮波纹效果
2016-12-09 16:08
288 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> #box{ width: 200px; height: 60px; margin: 50px auto; padding: 5px 0 0 10px; position: relative; } #box .btn{ width: 150px; height: 40px; line-height: 40px; border-radius: 30px; background: #26bfc5; cursor: pointer; text-align: center; color: #fff; z-index: 10; } .dot { width: 150px; height: 40px; top:5px; left:10px; border-radius: 30px; position: absolute; z-index: -10; animation: sploosh 2s cubic-bezier(0.165, 0.84, 0.44, 1); background: transparent; } @keyframes sploosh { 0% { box-shadow: 0 0 0 0px rgba(38, 191, 197, 0.5); background: rgba(38, 191, 197, 0.5); } 100% { box-shadow: 0 0 0 20px rgba(38, 191, 197, 0); background: rgba(38, 191, 197, 0); } } </style> </head> <body> <div id="box"> <div class="btn">点击</div> </div> <script src="js/jquery-1.12.3.min.js"></script> <script> $(function(){ $("#box .btn").click(function(){ setTimeout(function () { $('#box').append('<div class="dot"></div>') }, 300); setTimeout(function () { $('#box').append('<div class="dot"></div>') }, 0); setTimeout(function () { $('#box .dot').remove(); }, 2000); }); }) </script> </body> </html>
效果:
例子链接:http://pan.baidu.com/s/1sl6ejKx
相关文章推荐
- js点击按钮实现水波纹效果代码(CSS3和Canves)
- 仿android原生按钮点击水波纹效果
- 使用CSS实现按钮点击波纹效果
- css3实现波纹式动画,点击聚焦时设置内阴影实现按钮点击立体效果
- css3 实现 波纹效果
- css3的按钮效果,学习来的
- CSS3鼠标放上按钮悬浮框提示效果
- React Native android 按钮的波纹效果
- Android Ripple 按钮水波纹效果(一)
- Android 5.0+ 自定义普通按钮的ripple波纹效果
- css3 - 按钮元素动画效果
- 使用 CSS3 制作一组超时尚的动画按钮效果
- 按钮 CSS3悬浮按钮彩球效果
- 纯css3实现按钮的 hover 和 active 时颜色的明暗变化效果
- 简单实现安卓圆形按钮及(圆形)波纹效果
- CSS3实现的3D按钮精美效果
- 10个实用的 CSS3 按钮效果制作教程
- CSS3实现开关按钮效果
- Android Ripple 按钮水波纹效果(二)优化