Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因此,有很多解决方案可以像这样选择下一个选项卡
var selected = $("#tabs").tabs("option", "selected"); $("#tabs").tabs("option", "selected", selected + 1);
但是,如果我的下一个选项卡被禁用,并且我希望它超过 2 个选项卡,这将不起作用。
好吧,我在这里回答我自己的问题,并不太复杂,尽管我想我会分享我的想法(用咖啡脚本编写)
current = @$el.tabs('option', 'selected') counter = 1 while current == @$el.tabs('option', 'selected') and current + counter <= @$el.tabs('length') @$el.tabs 'select', current + counter++
我还考虑过向选项卡发送键盘事件以模拟右箭头键。欢迎评论