如何让 jQuery 选项卡包含(部分)共享内容?
我有一个网站,其中根据在其下方选择的选项卡显示四种不同类型的数据。
某些选项卡需要共享控件。滑块之类的。我不想在多个选项卡上复制它们,因为这需要始终同步它们的运行时状态。
我想我必须为这样的“具有共享内容的选项卡”进行自己的实现。有人已经有这个需求(并且可能解决了它)吗?
I've got a web site where four different kinds of data are shown, based on the tab selected below them.
Some of the tabs need shared controls. Sliders and the like. I don't want to duplicate them on multiple tabs, because that would require syncing also their runtime status all the time.
I presume I must make my own implementation for such a "tabs with shared contents". Anyone already had this need (and possibly solved it)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
制作您自己的简单选项卡解决方案(我想 3 到 10 行代码)
[或者找到一个以您需要的方式支持类的工具]
不要将内容放入名为
tab1
、tab2
等的 div 中,而是使用段落并为它们提供引用内容的类。然后使您的选项卡解决方案显示具有与选项卡关联的类的段落或者在更简单的情况下 - 使选项卡显示具有类
tabX
的 onlu 段落,并为某些段落提供多个类。完毕。
Make Your own simple tabbing solution (3 upto 10 lines of code I suppose)
[or find one that supports classes the way You need]
Instead of putting content in divs called
tab1
,tab2
etc. use paragraphs and give them classes that refer to content. Then make Your tabs solution show paragraphs with classes associated with the tabOr in a simpler case - make tabs show onlu paragraphs that have a class
tabX
and give multiple classes to some paragraphs.done.