Is there any way to run some function before and accordion it's fully opened?
Here's the code:
$.each($('.accordion-toggle'),function(){
$(this).click(function() {
if($(this).hasClass("collapsed")){
//loading content via ajax
};
});
I tried to use .on('show')
functions and changing data-toggle
with javascript opening and closing content, but it seems to be very complicated due to existing code.