我正在使用http://www.menucool.com/tabbed-content制作标签。
有没有办法通过jquery/javascript
更改选项卡?我尝试过 $("tab1").click();
为此创建了一个 fiddle - https://jsfiddle.net/6e3y9663/1/
最佳答案
玩选定的类别
$('.tabs').find('li.selected').removeClass('selected');//reset the tab buttons
$('#desiredTab').parent().addClass('selected');//or $('li a[href="#tab1"]').parent().addClass('selected'); - select the desired tab header
id = $('#desiredTab').attr('href');
$(id).siblings().hide();//reset the tab content
$(id).show();//$('#tab1').show(); -show the desired tab content
关于javascript - 如何以编程方式更改选项卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39507802/