我有一個使用HTML和CSS的登錄頁面。它功能齊全,所有這些東西。但是,當登錄失敗時,我想讓登錄表單動搖。我如何使它動搖。現在,它什麼也沒做。如何晃動登錄表單出錯
這是我的HTML/CSS/JavaScript。如果需要更多的代碼,請告訴我。
HTML
<div class="input">
<c:if test="${not empty error}">
<div class="error">${error}</div>
</c:if>
<c:if test="${not empty msg}">
<div class="msg">${msg}</div>
</c:if>
<div class="email">
<input type="text" name="username"
placeholder="[email protected]"></input>
</div>
<div class="password">
<input type="password" name="password" placeholder="*********"></input>
</div>
</div>
<input class="login_btn" type="submit" name="submit" value="">
CSS
.container .login_component .login_wrap .login_wp .input input {
width: 290px;
height: 50px;
padding-left: 20px;
font-size: 15px;
border: none;
background: transparent;
}
.container .login_component .login_wrap .login_wp .input .email {
height: 53px;
margin-top: 20px;
background:
url("http://xiilab.mynetgear.com:81/c.hwang/rems/images/login/input.png");
background-repeat: no-repeat;
background-position: center center;
}
.container .login_component .login_wrap .login_wp .input .password {
height: 53px;
margin-top: 20px;
background:
url("http://xiilab.mynetgear.com:81/c.hwang/rems/images/login/input.png");
background-repeat: no-repeat;
background-position: center center;
}
.container .login_component .login_wrap .login_wp .login_btn {
height: 55px;
margin-top: 30px;
background:
url("http://xiilab.mynetgear.com:81/c.hwang/rems/images/login/login_btn.png");
background-repeat: no-repeat;
background-position: center center;
border: none;
width: 310px;
}
的JavaScript
$('input[type=submit]').on('click', function(e){
e.preventDefault();
$('.input').addClass('ahashakeheartache');
});
$('.input').on('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(e){
$('.input').delay(200).removeClass('ahashakeheartache');
});
這可能是人們更容易地回答,而不必首先要挖一個大的一段代碼。如果* real *代碼不是真的需要,那麼最好給一個非常簡單的例子,或者甚至讓代碼完整。 :) – JakeTheSnake