jQuery 弹出表单?
我有一个表单,目前位于 php 页面的一个分区中。
我希望它执行以下操作:
- 用户单击链接以在屏幕中心的弹出部分中显示表单
- 用户填写表单
- 用户点击提交按钮
- 表单关闭并显示另一个小部分,并显示一条感谢消息5 秒然后消失
实现此目的最简单的方法是什么?
我目前在相关网站上有 jQuery 和 jQuery Tools 脚本。
编辑:我不能使用 jquery-ui,因为它与 jQuery 工具手风琴冲突。
I have a form which is currently sitting in a division on a php page.
I would like it to do the following:
- User clicks link to bring up form in pop-up division in center of screen
- User fills out the form
- User hits the submit button
- Form closes and brings up another small division with a thank you message which shows for 5 seconds then disappears
What's going to be the easiest way to achieve this?
I currently have jQuery and jQuery Tools scripts on the site in question.
EDIT: I'can't use jquery-ui as that conflicts with jQuery tools accordion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该查看有关 jQuery UI 对话框的文档:
http://jqueryui.com/demos/dialog/< /a>
还可以查看
模态表单
(查看页面右侧的导航菜单)。基本上,您只需在对话框内设置一个表单。
通过使用 jquery 对话框和诸如
setTimeout
之类的东西来关闭它,让谢谢 - 对话框显示几秒钟也很容易。不要忘记将 jQuery 和 jQuery UI 库包含到源代码中。如果您不了解 jQuery,请先查看一些 jQuery 教程。
You should have a look at this documentation about jQuery UI Dialogs:
http://jqueryui.com/demos/dialog/
Have also a look at
Modal Forms
(look at the navigation menu at the right of the page).Basically, you only set up a form inside of a dialog.
Having that thank you -Dialog show up for a few seconds is also easy by using jquery Dialogs and something like
setTimeout
to close it.Don't forget to include the jQuery and jQuery UI libraries into your source code. Have a look at some jQuery tutorial first, if you don't know jQuery.
对于类似的任务,我使用了 JQuery UI 对话框
http://jqueryui.com/demos/dialog/#模态形式
For similar task, I used JQuery UI Dialog
http://jqueryui.com/demos/dialog/#modal-form