【发布时间】:2012-07-24 05:59:47
【问题描述】:
所以,我有一个带有背景图片(信封)的表格。提交后,我想留在同一页面上并折叠包含表单的 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>
【问题讨论】:
-
您是在问如何实现 Ajax 提交,还是只是关于折叠动画?不管怎样,花几分钟时间阅读this list of jQuery methods,我相信你会找到你需要的。
标签: javascript jquery forms