Viktor
Viktor

Reputation: 722

Jquery ui tabs, second added tab not working

If you click on title 'Link', you can see tabs not working. What did i do wrong? And how could i make, height of each tab in addiction of content amount

Jquery:

$( "#accordion" ).accordion({
      collapsible: true

  });
$( "#tabs" ).tabs();

Full code Jsfiddle

Upvotes: 0

Views: 101

Answers (1)

Guruprasad J Rao
Guruprasad J Rao

Reputation: 29683

You have ids duplicated whereas it has to be unique. So either change id of 2nd tabs to tabs1 and initialize as below:

$("#tabs,#tabs1").tabs()

DEMO with different ids

or

change id to class as for both the tabs as below:

<div class="tabs">
  ....
</div>

<div class="tabs">
  ....
</div>

and initialize it as below:

$('.tabs').tabs()

DEMO with same class


UPDATE

To make, height of each tab in addiction of content amount you could just add one CSS to .tabs, and set its height property to auto !importantas below:

.tabs{
    height:auto !important;
}

Updated DEMO

Upvotes: 1

Related Questions