$('[href=#tab]').on('shown.bs.tab', function (e) {
$('.item').matchHeight();
});
$('[href=#tab]').on('hide.bs.tab', function (e) {
........
});
Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.