【发布时间】:2016-06-26 10:46:27
【问题描述】:
我有使用单选按钮的 html 选项卡,如本演示 https://css-tricks.com/examples/CSSTabs/radio.php 中所示。 标记是这样的:
<div class="tab">
<input type="radio">
<p>Content shown when radio button is checked</p>
</div>
<div class="tab">
<input type="radio">
<p>Content shown when radio button is checked</p>
</div>
<div class="tab">
<input type="radio">
<p>Content shown when radio button is checked</p>
</div>
现在我想运行一个循环以在一个之后自动显示一个选项卡内容(因此自动检查单选按钮,取消选中前一个),然后循环回到第一个单选并开始检查,再次显示第一个内容。
我在这里找到了一个非常相似的解决方案:Check radio buttons in a loop with a delay,但它对我不起作用,因为我将单选按钮放在单独的容器中。
jQuery 可以吗? 提前感谢您的帮助。
【问题讨论】:
-
你试过什么?展示“类似的解决方案”以及您对它的尝试。不要指望我们为你做你的工作。
-
我的错误,我没有正确添加链接。我的第一个问题:-)
标签: javascript jquery html tabs radio-button