我仅在动画完成并完成后才尝试提交表单
代码 ------> http://pastie.org/5109573
<form action='loginn.php' method='post'>
<fieldset>
<legend>Register</legend>
<label for='username'>Username*:</label>
<input type='text' name='username' id='username' maxlength="50"
/>
<label for='password'>Password*:</label>
<input type='password' name='password' id='password'
maxlength="50" /> <a><input class ="animated" type='submit' name='Submit' value='Submit' /></a>
</fieldset>
</form>
<span></span>
<script src="jquery.js"></script>
<script>
$("form").submit(function () {
event.preventDefault();
if ($("input:first").val() == "correct") {
$("span").text("OKAY :D").show().fadeOut(1000);
$("a").addClass('animated hinge');
$("span").promise().done(function () {
return true;
});
} else {
$("span").text("Not valid!").show().fadeOut(1000);
return false;
}
});
</script>
</body>
</html>
表单在动画完成之前提交!