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 index = $('#accordion .in').parent().index();
您可以使用以下方法获取手风琴组手风琴组:
var accordionItem = $('.accordion .accordion-body.in:first').parents('.accordion-group');
现在您可以获得手风琴项的索引。