将 Jquery 选项卡面板添加到特定 div
我确信这个问题已经有了答案,但我花了几个小时寻找,但没有运气。
这是我的基本设置。
<div id='container'>
<ul id="tabs">
<li>Tab 1</li>
<li>Tab 2</li>
</ul>
<div id="panels">
<div>panel 1</div>
<div>panel 2</div>
</div>
</div>
当我动态添加新选项卡时,我希望该选项卡显示在“面板”div 内,如“面板 1”和“面板 2”。
但是,当我动态添加“选项卡 3”(见下文)时,“面板 3”将添加到面板选项卡下方而不是其内部。
<div id='container'>
<ul id="tabs">
<li>Tab 1</li>
<li>Tab 2</li>
<li>Tab 3</li>
</ul>
<div id="panels">
<div>panel 1</div>
<div>panel 2</div>
</div>
<div>panel 3</div>
</div>
如何将新的“panel 3”面板添加到“panels”div?
I was sure there was an answer to this question already but I've spent several hours looking with no luck.
This is my basic setup.
<div id='container'>
<ul id="tabs">
<li>Tab 1</li>
<li>Tab 2</li>
</ul>
<div id="panels">
<div>panel 1</div>
<div>panel 2</div>
</div>
</div>
When I dynamically add a new tab I would like the tab to appear inside the "panels" div like "panel 1" and "panel 2".
However, when I dynamically add "tab 3" (see below) "panel 3" is added below the panels tab not inside it.
<div id='container'>
<ul id="tabs">
<li>Tab 1</li>
<li>Tab 2</li>
<li>Tab 3</li>
</ul>
<div id="panels">
<div>panel 1</div>
<div>panel 2</div>
</div>
<div>panel 3</div>
</div>
How can I add my new "panel 3" panel to the "panels" div?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样:
这将在
panels
内移动panel3
Like this:
This will move
panel3
insidepanels