jQuery( document ).ready(function() { /* CLICK on the column and find the first link */ jQuery(".clickable-column.wp-block-kadence-column").click(function() { var href = jQuery(this).find("a").attr("href"); if (href != "") { window.location.href = href; } }); /* Pour l'accessibilité Web */ jQuery("button.dropdown-nav-special-toggle").each(function() { jQuery(this).attr("aria-haspopup", "true"); }); /* Table */ jQuery("figure.wp-block-table > table").each(function(index) { var headers = []; jQuery(this).addClass("standish-mobile-table-" + index); jQuery(this).find("thead > tr > th").each(function() { headers.push(jQuery(this).html()); }); console.log(headers); headers.forEach(function (header, headerIndex) { document.querySelector('style').textContent += "@media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) { figure.wp-block-table table.standish-mobile-table-" + index +" td:nth-of-type(" + (headerIndex + 1) + "):before { content: '" + header + "'; } }"; }); }); });