javascript - 动画双箭头 - CSS

标签 javascript jquery html css

请仔细阅读我的问题。我已经过去两天了,但仍然无法弄清楚。

如果你去这里http://thekitchen.com你会看到动画双箭头http://prntscr.com/ewcvn4

我在网上搜索了很多次并复制了他们的代码,但它不起作用。

有没有办法制作类似的动画双箭头?

另外,我需要网站的动画。我了解 Animate CSS 和 WOW JS。但它不能迭代动画。那么如何在我的网站上实现他们的动画呢?

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>SVG Animation</title>
	<style>
		body{
			background-color: green;
		}
		.narrative-inner-slide-cta{
			position: absolute
		}
		.narrative-inner-slide-cta {
		    list-style: none;
		    display: -ms-flexbox;
		    display: -webkit-flex;
		    display: flex
		}
		.narrative-inner-slide-cta {
		    -ms-flex-align: center;
		    -webkit-align-items: center;
		    align-items: center
		}
		.narrative-inner-slide-cta {
		    -ms-flex-direction: column;
		    -webkit-flex-direction: column;
		    flex-direction: column
		}
		.narrative-inner-slide-cta {
		    bottom: 3rem;
		    left: 0;
		    right: 0;
		    width: 5rem;
		    margin-right: auto;
		    margin-left: auto;
		    opacity: 0
		}
		.narrative-inner-slide-cta {
		    -moz-animation: show-slide-cta .5s ease-in-out forwards .7s;
		    -webkit-animation: show-slide-cta .5s ease-in-out forwards .7s;
		    animation: show-slide-cta .5s ease-in-out forwards .7s
		}

		.arrowCta {
		    bottom: 0;
		    background-color: transparent;
		    color: #3a261e;
		    position: absolute;
		    left: 0;
		    right: -3px;
		    margin-right: auto;
		    margin-left: auto;
		    width: .2rem;
		    -moz-transform: rotate(45deg);
		    -ms-transform: rotate(45deg);
		    -webkit-transform: rotate(45deg);
		    transform: rotate(45deg)
		}
		.arrowCta--alt{
		    color: #fff
		}
		.arrowCta:after,
		.arrowCta:before {
		    border-right: 3px solid #3a261e;
		    border-bottom: 3px solid #3a261e;
		    border-left: 0 solid transparent;
		    border-top: 0 solid transparent;
		    top: 0;
		    left: 0;
		    opacity: 1;
		    -webkit-font-smoothing: antialiased;
		    height: .75rem;
		    width: .75rem
		}
		@media only screen and (min-width: 40.0625em) {
		    .arrowCta:after,
		    .arrowCta:before {
		        height: 1.125rem;
		        width: 1.125rem;
		        bottom: 1.125rem
		    }
		}
		.arrowCta:before {
		    -moz-animation: top-arrow 2s infinite;
		    -webkit-animation: top-arrow 2s infinite;
		    animation: top-arrow 2s infinite
		}
		.arrowCta:after {
		    -moz-animation: bottom-arrow 2s infinite;
		    -webkit-animation: bottom-arrow 2s infinite;
		    animation: bottom-arrow 2s infinite
		}
		.arrowCta--alt:after,
		.arrowCta--alt:before {
		    border-right: 3px solid #fff;
		    border-bottom: 3px solid #fff
		}

		.arrowCta:after,
		.arrowCta:before{
		    display: block;
		    position: absolute;
		}
		.arrowCta--alt:after,
		.arrowCta--alt:before,
		.arrowCta:after,
		.arrowCta:before {
		    content: ""
		}
	</style>
</head>
<body>
	<div class="narrative-inner-slide-cta">
        <button class="arrowCta  arrowCta--alt"></button>
    </div>
</body>
</html>

最佳答案

您缺少一些重要的 css,无法根据需要为其设置动画。在这里,我创建了一个 jsfiddle - 看看...

<button class="arrowCta  arrowCta--alt "></button>

关于javascript - 动画双箭头 - CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43410501/

相关文章:

javascript - Three.js动画混合器无法播放?

Javascript 在下拉选择中停止 TR 单击事件

javascript - 分别为数据集制作动画

jquery - Ajax 命令请求 URL 不再起作用

jquery 克隆。单击事件不会在新创建的克隆行上触发

javascript - JQuery 有问题

javascript - echo 中的 PHP 提交按钮可以做一些 javascripting

javascript - 如何使用delay()清除事件调用集

html - 为什么我的斑马条纹 CSS 不适用于我的表格行?

html - 如何使用 erlang gen_smtp 发送 html 格式的电子邮件?