0

I am trying to modify the 'Collapsable and Tabs' widget to a Bootstrap one but I am stuck on finding out the IP of a whole collapsable/tab group/container.

It's needed to set a unique ID to each group like this:

<div class="panel-group" id="<?php echo $widgetId ?>">
  [Tab 1]
  [Tab 2]
  ...
</div>

Already tried to check out examples but I am stuck.

Can anybody help me out?

Christina
  • 34,296
  • 17
  • 83
  • 119

2 Answers2

0

You can try :

var collapseIn = $('.panel-group').find('div.collapse.in')[0];
if (collapseIn) console.log($(collapseIn).attr('id'));

Example here jsbin

Ryan Nghiem
  • 2,417
  • 2
  • 18
  • 28
0

I solved this looking at the Accordion widget where the IDs are called from within the php.