occurs when the user clicks on the tab
tabbar.attachEvent("onTabClose", function(id, last_id){ //any custom code return true; });