如何在按下按钮后添加到按钮中。它会在5秒之后将我重定向到一侧? 我已经尝试了这么多不同的东西,但它不适合我... 它需要是一个onClick函数(javascript)。onClick 5秒后重定向到一侧
HTML:
<html>
<head>
<style type="text/css">
#save_first { display: none; }
#save_second { display: none; }
#save_third { display: none; }
</style>
<script type="text/javascript" src="http://mctheblitz.com/servers/js/jquery.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
</head>
<body>
<input type="button" value="Save" onClick="save();"/>
<div id="save_first"></div><div id="save_second"></div>
<?php
</body>
</html>
javascipt的:
function save() {
$('#save_first').html('Validating...');
$('#save_first').fadeIn(1);
$('#save_first').delay(2000);
$('#save_first').fadeOut(300);
$('#save_second').html('Successfully log in!');
$('#save_second').hide();
$('#save_second').delay(2350);
$('#save_second').fadeIn(0);
}
TNX的帮助!
它只是一个基地。你需要在5秒设定某种块。 – Daniel