Corsi
window.addEventListener('elementor/frontend/init', () => {
elementorFrontend.hooks.addAction('frontend/element_ready/tabs.default', function($scope) {
const hash = window.location.hash.substring(1); // rimuove il #
if (hash) {
// Rimuove lo stato attivo da tutte le tab all'interno di questo widget
$scope.find('button.e-n-tab-title').each(function() {
jQuery(this).removeClass('e-n-tab-title-active').attr('aria-selected', 'false');
});
// Nasconde tutti i contenuti delle tab
$scope.find('.e-n-tab-content').hide();
// Trova la tab con l'ID corrispondente al valore dell'hash
const targetTab = $scope.find(`button#${hash}`);
if (targetTab.length) {
// Simula il click per attivare la tab corretta
targetTab.trigger('click');
}
}
});
});