limit carroussel à madia image
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -183,8 +183,10 @@ jQuery(function ($) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/////////////////diaporama ressource //////////
|
/////////////////start diaporama ressource //////////
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
// Vérifie que le body a la classe souhaitée
|
||||||
|
if (!document.body.classList.contains('type-media-images---photos')) return;
|
||||||
// Attendre que les éléments HTML soient bien présents
|
// Attendre que les éléments HTML soient bien présents
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
const mainImage = document.getElementById('mainImage');
|
const mainImage = document.getElementById('mainImage');
|
||||||
@@ -259,7 +261,7 @@ function initCarousel({ mainImage, prevArrow, nextArrow, caption, thumbsContaine
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/////////////////end diaporama ressource //////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////start classe en JS si des filtres sont présents///////////
|
//////////////////////////start classe en JS si des filtres sont présents///////////
|
||||||
@@ -270,22 +272,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//////////////////////////end classe en JS si des filtres sont présents///////////
|
||||||
|
|
||||||
// ////////////////// 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
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// ////////////////// start tronquage sous titre //////////////////
|
// ////////////////// start tronquage sous titre //////////////////
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
@@ -300,4 +287,5 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// //////////////////end tronquage sous titre //////////////////
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user