Search code examples
jquery-tabs

Closing jQuery Ui Tabs


I have followed the instructions on the jQuery site to close jQuery tabs but its not working. below is my code snippet.

<script type="text/javascript" src="js/ui.tabs.closable.min.js"></script>

var mainTab = $("#contentTab").tabs({closable: true});
$("#checkup").click(function(){

mainTab.tabs('add','checkup.php','CheckUp');
var newIndex = mainTab.tabs("length") - 1;
mainTab.tabs("select", newIndex);
});

$("#registration").click(function(){

mainTab.tabs('add','reception.php','Registration');
var newIndex = mainTab.tabs("length") - 1;
mainTab.tabs("select", newIndex);

Solution

  • Check out A Close Button for jQuery UI Tabs and working demo.