I am having trouble to find the clicked anchor element in the collapse event using Bootstrap 3.3.4.:
$('.collapse').on('show.bs.collapse', function (e) {
// Get clicked element that initiated the collapse...
});
I need this because I'd like to prevent collapsing if the clicked element has a certain data attribute. Another option would be to hook in by using .on('click', function())
, however there are other events that occur on click that need to run so this seems a no-go to me. Searching in the DOM for the closest anchor or something similar won't work as well since there are multiple anchors next to eachother.