Compare commits
2 Commits
f218e340f1
...
fb9ffed293
Author | SHA1 | Date | |
---|---|---|---|
fb9ffed293 | |||
84fece051f |
File diff suppressed because one or more lines are too long
@ -1627,7 +1627,7 @@ footer {
|
|||||||
}
|
}
|
||||||
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_body p {
|
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_body p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 0.5rem;
|
||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
}
|
}
|
||||||
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_field_liens {
|
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_field_liens {
|
||||||
|
@ -358,17 +358,34 @@
|
|||||||
/////////////////// caracteres body actus/////////////////////////
|
/////////////////// caracteres body actus/////////////////////////
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Maximum number of characters to display
|
// Nombre maximum de caractères à afficher
|
||||||
const maxChars = 140; // Adjust this value as needed
|
const maxChars = 140; // Ajustez cette valeur selon vos besoins
|
||||||
|
|
||||||
document.querySelectorAll('#actus-caroussel .node-type-actualite .field_body p').forEach(function(paragraph) {
|
document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
|
||||||
let text = paragraph.textContent.trim();
|
let paragraphs = node.querySelectorAll('.field_body p');
|
||||||
if (text.length > maxChars) {
|
let fullText = "";
|
||||||
let truncatedText = text.slice(0, maxChars) + '...';
|
|
||||||
paragraph.textContent = truncatedText;
|
// Concaténer tous les paragraphes
|
||||||
}
|
paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
|
||||||
|
fullText = fullText.trim();
|
||||||
|
|
||||||
|
// Vérifier si le texte dépasse la limite
|
||||||
|
if (fullText.length > maxChars) {
|
||||||
|
let truncatedText = fullText.slice(0, maxChars) + '...';
|
||||||
|
|
||||||
|
// Vider tout le contenu et insérer seulement le texte tronqué
|
||||||
|
let firstParagraph = paragraphs[0];
|
||||||
|
firstParagraph.textContent = truncatedText;
|
||||||
|
|
||||||
|
// Masquer les autres paragraphes
|
||||||
|
for (let i = 1; i < paragraphs.length; i++) {
|
||||||
|
paragraphs[i].style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////// start slideshow home //////////////////////////
|
//////////// start slideshow home //////////////////////////
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
font-family: 'gilroy-regular';
|
font-family: 'gilroy-regular';
|
||||||
p{
|
p{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 0.5rem;
|
||||||
font-size: 0.7rem ;
|
font-size: 0.7rem ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user