如何制作可交换的 div 'ui 卡'用 jQuery?
例如,如果您有一个向导,其中包含询问信息的分步说明,则每个 div 将具有每个步骤所需的控件(一次仅显示一个 div)。然后,您将逐一交换它们,从而在一个页面加载中完成一个多步骤过程。这在 jQuery 中很容易做到吗?您能否让一个表单跨多个 div 并一次提交所有内容?
For example if you had a wizard that had step by step directions asking for information, each div would have the controls needed for each step (only one div shows at a time). Then you would swap through them one by one, hence going through a multi-step process all in one page load. Is this pretty easy to do in jQuery? Could you have one form span across multiple divs and submit all at once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,只需使用 .hide() 和 .show() 在正确的时间显示/隐藏适当的 DIV。
是的,表单可以跨越多个 div,您可以在最后提交。
另外,看看这个插件:
http://worcesterwideweb.com/jquery/wizard/
它基本上按照我所描述的进行。
Basically, just use the .hide() and .show() to show/hide the appropriate DIV at the right time.
Yes, forms can span across multiple divs and you can submit at the end.
Also, take a look at this plugin:
http://worcesterwideweb.com/jquery/wizard/
It basically does what I described.