Add functionality to dynamically set the 'active' class for the appropriate navbar list item.