1document.addEventListener('DOMContentLoaded', () => { 2 const faqChoices = document.querySelectorAll('.faq-choice'); 3 4 // Fonction pour récupérer un paramètre spécifique de l'URL 5 function getQueryParam(param) { 6 const urlParams = new URLSearchParams(window.location.search); 7 return urlParams.get(param); 8 } 9 10 // Définir les correspondances entre "c" et les divs à afficher 11 const codeMapping = { 12 "code": "level-2-1-1", // c=code affiche la div level-2-1-1 13 14 "acpcc": "level-2-1-1-1", // Affiche avoir promo libre 15 "accst": "level-2-1-1-2", // Affiche abo cc site partenaire 16 17 "tuto_avoir": "level-2-1-1-3", // Affiche le tuto avoir 18 "tuto_libre": "level-2-1-1-4", // Affiche le tuto libre 19 "tuto_promo": "level-2-1-1-5", // Affiche le tuto promo 20 "tuto_accst": "level-2-1-1-6", // Affiche le tuto abo cc site partenaire 21 }; 22 23 // Vérifier si un paramètre "c" est présent dans l'URL 24 const codeParam = getQueryParam('choix'); 25 26 if (codeParam && codeMapping[codeParam]) { 27 const targetDivId = codeMapping[codeParam]; // Récupérer l'ID correspondant 28 const targetDiv = document.getElementById(targetDivId); 29 30 if (targetDiv) { 31 // Masquer tous les autres niveaux avant d'afficher la div ciblée 32 document.querySelectorAll('.faq-level').forEach(level => { 33 level.classList.add('hidden'); 34 level.classList.remove('fade-in'); 35 }); 36 37 // Afficher la div correspondante avec animation 38 targetDiv.classList.remove('hidden'); 39 targetDiv.classList.add('fade-in'); 40 } else { 41 console.warn(`Aucune div trouvée avec l'ID : ${targetDivId}`); 42 } 43 } 44 45 // Gestion des clics pour naviguer dans la FAQ 46 faqChoices.forEach(choice => { 47 choice.addEventListener('click', () => { 48 const nextLevelId = choice.getAttribute('data-next'); 49 50 if (nextLevelId) { 51 // Masquer tous les niveaux 52 document.querySelectorAll('.faq-level').forEach(level => { 53 level.classList.add('hidden'); 54 level.classList.remove('fade-in'); 55 }); 56 57 // Afficher le niveau suivant avec animation 58 const nextLevel = document.getElementById(nextLevelId); 59 if (nextLevel) { 60 nextLevel.classList.remove('hidden'); 61 nextLevel.classList.add('fade-in'); 62 } 63 } 64 }); 65 }); 66});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.