padding h3
This commit is contained in:
@@ -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
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user