added support for passing in arbitrary callback function to determine whether or not to add the active class to the tapped element