【发布时间】:2018-06-29 05:06:00
【问题描述】:
我从 div 中创建了一条线,现在我要做的是为 div 颜色设置动画,背景为灰色,然后填充为白色,然后白色填充回灰色,就像它滑过一样。然后悬停在行和文本向上滑动约 10 像素,然后当释放它回到默认位置。
喜欢这个在底部example
.scroll-indicator {
position: absolute;
left: 50%;
bottom: 0;
z-index: 340;
display: inline-block;
width: 4.16667%;
height: 6.66667%;
min-height: 60px;
font-family: 'rajdhani', 'Helvetica Neue', Helvetica, sans-serif;
font-weight: bold;
font-style: normal;
color: #000;
font-size: 16px;
}
.scroll-indicator .border-grey {
position: absolute;
left: 0;
top: 0;
z-index: 100;
width: 2px;
height: 100%;
background: #333;
}
.scroll-indicator .border {
position: absolute;
left: 0;
top: 0;
z-index: 200;
width: 2px;
height: 100%;
background: #000;
}
.scroll-indicator em {
display: inline-block;
font-style: normal;
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
-webkit-transform-origin: center center;
transform-origin: center center;
position: absolute;
left: 0px;
top: 12px;
}
@media screen and (max-width: 800px) {
.scroll-indicator {
bottom: 0;
}
}
<a href="" class="scroll-indicator" style="opacity: 1; transform: matrix(1, 0, 0, 1, 0, 0);">
<div class="border-grey"></div>
<div class="border" style="transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: 0% 0% 0px;"></div>
<em>scroll</em>
</a>
【问题讨论】:
-
您能否提供一个指向 JSFiddle 的链接,以便对其进行正确测试和试验?此外,从这个问题中不清楚你的问题是什么。 S/O 不是要求完成工作的地方,而是回答您面临的特定问题的地方。请详细说明您能够完成的工作、您尝试过的工作、有效的工作、无效的工作等。
-
上面的代码 sn-p 工作正常,只是没有线条动画
标签: css css-animations