小编给大家分享一下如何使用CSS和Bootstrap图标制作上下跳动的指示箭头动画效果,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
HTML:添加一个链接,可修改锚点点击时滑动到指定位置,这里使用了Bootstrap 3.x版本的一个向下箭头作为图标。
<a href="#" class="scroll-down"> <span> <i class="glyphicon glyphicon-chevron-down"></i> </span></a>
CSS: 添加动画效果
@-webkit-keyframes drop { 0% { top:0px; opacity: 0;} 30% { top:10px; opacity: 1;} 100% { top:25px; opacity: 0;}}@keyframes drop { 0% { top:0px; opacity: 0;} 30% { top:10px; opacity: 1;} 100% { top:25px; opacity: 0;}}.scroll-down { border: 2px solid #bbb; border-radius: 50%; margin: 0 auto; height: 50px; width: 50px; display: block; text-align: center; z-index: 10; -webkit-transition: all 0.125s ease-in-out 0s; -moz-transition: all 0.125s ease-in-out 0s; -ms-transition: all 0.125s ease-in-out 0s; -o-transition: all 0.125s ease-in-out 0s; transition: all 0.125s ease-in-out 0s;}.scroll-down span { position: relative; color: #bbb; font-size: 24px; -webkit-animation-name: drop; -webkit-animation-duration: 1s; -webkit-animation-timing-function: linear; -webkit-animation-delay: 0s; -webkit-animation-iteration-count: infinite; -webkit-animation-play-state: running; animation-name: drop; animation-duration: 1s; animation-timing-function: linear; animation-delay: 0s; animation-iteration-count: infinite; animation-play-state: running;}
以上是“如何使用CSS和Bootstrap图标制作上下跳动的指示箭头动画效果”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程网行业资讯频道!