Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide jquery UI bootstrap tab

Is there any way to hide the Jquery UI bootstrap tab I have written code below to show the particular tab

 $('#myTab a:last').tab('show')

So i tried using below code to hide tab but it gives error that it has no method hide

 $('#myTab a:last').tab('hide')

I have declared tabs in following way in my html

 <ul class="nav nav-tabs" id="myTab">
        <li><a href="#product" data-toggle="tab">Company</a></li>
        <li><a href="#version" data-toggle="tab">Employee</a></li>
  </ul>
like image 756
DevelopmentIsMyPassion Avatar asked Jan 30 '13 12:01

DevelopmentIsMyPassion


2 Answers

Have you tried $('#myTab a:last').hide() or $('#myTab a:first').hide() ?

like image 64
Mandeep Jain Avatar answered Oct 22 '22 21:10

Mandeep Jain


Alternatively, you could simply remove the active class from the elements instead:

$('.nav-tabs li.active').removeClass('active');
$('.tab-content div.active').removeClass('active');

This way you won't have any hidden elements that are still marked as active, which may interfere with other JS or CSS.

like image 8
Igor Avatar answered Oct 22 '22 19:10

Igor