创建具有动态内容的 js 选项卡
我需要一些有关选项卡的帮助。
我们正在为客户建立一个内联网门户,他们将能够在其中创建名片等。但由于选项卡的问题,我们已经停止了。
我们需要在选项卡中进行大约 1-4 个步骤的过程。第一步是选择名片模板。选择模板后,下一步就是填写它。
然而,每个模板都有不同类型的输入字段,使得第 2 步选项卡的高度可变。
我们尝试使用 Jquery UI 中的选项卡,但只有第一步有效,因为某些模板的下一步将因高度而被切断。
解决这个问题的最佳方法是什么?
I need some help regarding tabs.
We are building a intranet portal for our clients, where they will be able to create business cards and more. But we've come to a halt because of problems with tabs.
We need to have a approx 1-4 steps process in tabs. 1 step is to select a business card template. When the template is chosen the next step would be to fill it out.
However each template has different kinds of input fields making the height of the step 2 tab variable.
We've tried using the tabs from Jquery UI, but only the first step is working, since the next step on some templates will be cut off, because of the height.
What is the best way around this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我经常使用 JQuery 选项卡,但从未见过这个问题。 AFAIK,选项卡本身并没有限制可以放入其中的内容。我会尝试从选项卡中删除所有逻辑、html、附加 js 等,并使内容变得简单(例如一系列具有固定高度的 div)。我想您会看到选项卡只是打开到其内容的整个高度。然后开始重新添加代码,直到找到限制选项卡高度的内容。顺便说一句,我不认为它们的选项卡是静态创建还是通过 ajax 加载有任何区别......
I've used JQuery tabs a lot, and never seen this problem. AFAIK, there is nothing about the tabs themselves that restricts the content that can be put inside them. I would try removing all the logic, html, additional js etc from your tabs, and making the content simple (a series of divs with a fixed height for example). I think you will see that the tabs simply open up to the full height of their contents. Then start adding your code back in until you find whatever it is that restricts the height of your tabs. BTW, I don't think it makes any difference whether they tabs are statically created or loaded via ajax either ...
你不能也写一些像
height()
这样的代码来修复 jquery ui 的问题吗?我认为 jquery ui 是最好的选择。Can't u also write some code like
height()
to fix the jquery ui thing? I think jquery ui is the best choice.