padding h3

This commit is contained in:
2025-06-05 09:19:51 +02:00
parent d0f3453dff
commit 539c0f5075
5 changed files with 28 additions and 23 deletions
+13 -13
View File
@@ -272,18 +272,18 @@ document.addEventListener('DOMContentLoaded', () => {
});
////////////////// start tronquage sous titre //////////////////
document.addEventListener("DOMContentLoaded", function () {
const maxLength = 20; // <-- modifiez cette valeur si besoin
const field = document.querySelector(".field--name-field-sous-titre a");
// ////////////////// start tronquage sous titre //////////////////
// document.addEventListener("DOMContentLoaded", function () {
// const maxLength = 20; // <-- modifiez cette valeur si besoin
// const field = document.querySelector(".field--name-field-sous-titre a");
if (field) {
const fullText = field.textContent.trim();
if (fullText.length > maxLength) {
const truncated = fullText.slice(0, maxLength).trim() + "...";
field.textContent = truncated;
field.setAttribute("title", fullText); // Affiche le texte complet au survol
}
}
});
// if (field) {
// const fullText = field.textContent.trim();
// if (fullText.length > maxLength) {
// const truncated = fullText.slice(0, maxLength).trim() + "...";
// field.textContent = truncated;
// field.setAttribute("title", fullText); // Affiche le texte complet au survol
// }
// }
// });