【发布时间】:2018-10-12 07:48:54
【问题描述】:
现在我正在尝试在按下按钮时向 div 添加动画。 但是,我不确定如何使用 JavaScript 或 jQuery 在按钮单击时触发自定义动画。到目前为止,我还没有为此编写任何 JavaScript。
我对此很陌生,因此我问专业人士!
HTML:
<div class="container" id="frontPage">
<div "container">
<h1 class="header center green-text">ABOUT</h1>
<div class="row center">
<p class="header col s12 light">Something here</p>
</div>
</div>
<div class="row center padding-bottom-1">
<a a href="{{ url('/loginpage') }}" class="btn-small green" id="loginButton">login</a>
<a class="btn-small green">apply</a>
</div>
</div>
CSS:
#frontPage {
text-align: center;
margin-top: 80px;
position: relative;
animation-name: slideOutLeft;
animation-duration: 1s;
animation-fill-mode: forwards;
width: 500px;
}
@keyframes slideOutLeft {
0% {left: 0;}
100% {left: -1500px;}
}
【问题讨论】:
-
你可以做一些搜索,你会得到它:google.com/…
标签: javascript jquery html css