gpt4 book ai didi

javascript - 如何在此代码中的选项卡内制作选项卡?

转载 作者:行者123 更新时间:2023-11-28 01:32:33 26 4
gpt4 key购买 nike

请告诉我如何在这段代码中制作标签内标签?

$('.tabs-box').each(function(){
$(this).find('.tabs-sel span:first').addClass('current');
$(this).find('.tabs-b:first').addClass('visible');
});
$('.tabs-sel').delegate('span:not(.current)', 'click', function() {
$(this).addClass('current').siblings().removeClass('current')
.parents('.tabs-box').find('.tabs-b').hide().eq($(this).index()).fadeIn(400);
});
.tabs-b {display:none;}
.tabs-b.visible {display:block;}
.tabs-sel {padding:20px 0 0 20px;}
.tabs-sel span {display:inline-block; padding:10px 20px; vertical-align:top; cursor:pointer;}
.tabs-sel span.current {background-color:#4e647a;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="tabs-box">
<div class="tabs-sel"><span class="current">1</span><span>2</span><span>3</span></div>
<div class="tabs-b visible">12</div>
<div class="tabs-b">13</div>
<div class="tabs-b">14</div>
</div>

https://codepen.io/senopsisder/pen/zaEpBV

最佳答案

Try something like this in one of the sub tabs:

  <div class="tabs-b visible">
<div class="tabs-sel">
<span class="current">12</span>
</div>
</div>

关于javascript - 如何在此代码中的选项卡内制作选项卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50881071/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com