所以,我有一张带有背景图片(信封)的表格。提交后,我希望保持在同一页面上并折叠包含表单的div的一部分,并显示一个图片谢谢你bla bla。怎么做这个顺利崩溃和更换?如果有人有一些想法或链接,我将不胜感激。
<script type="text/javascript">
$(document).ready(function() {
$("#form1").submit(function(){
$("#formplic").html("<img src='images/thanks.png'/>");
});
});
</script>
<div id="formplic"><img src="images/form.png"/></div>
<form id="form1" action="send.php" onSubmit="return chkForm(this)" name="form1" method="post" >
<textarea name="message" cols="4" rows="4" id="message" value=""></textarea>
<input type="text" id="name" name="name" value="" />
<input type="text" id="email" name="email" value="" />
<input type="submit" value="" id="submit" />
</form>
答案 0 :(得分:2)
一些褪色的东西怎么样?
$(document).ready(function() {
$("#form1").submit(function(){
$("#formplic").fadeOut(1000, function() {
$(this).html("<img src='images/thanks.png'/>").fadeIn(1000);
});
});
});
或滑动的东西?
$(document).ready(function() {
$("#form1").submit(function(){
$("#formplic").slideUp(1000, function() {
$(this).html("<img src='images/thanks.png'/>").slideDown(1000);
});
});
});
这种事情应该是非常直接的,只需要一点点搜索!