Bladeren bron

add offre de service

ouidade 3 jaren geleden
bovenliggende
commit
727046c860

+ 1 - 1
web/themes/custom/eql/eql.theme

@@ -36,7 +36,7 @@ function eql_preprocess_node(&$variables){
             //   // $variables['counter'] = $counter++;
             //   $variables['elements']['#paragraph']->item_id;
             // }
-// la fonction suivante ne sert à rien
+// la fonction suivante ne fonctionne pas
 // function eql_preprocess_field(&$variables) {
 
 //   $paragraph = &$variables['paragraph'];

+ 26 - 6
web/themes/custom/eql/scripts/main.js

@@ -24,15 +24,35 @@ for (let i = 0; i < questions.length; i++) {
   const question = questions[i]
   question.addEventListener("click", toggleFaq);
 }
-
-
 function toggleFaq(event) {
-  console.log(event);
-  for (let i = 0; i < answers.length; i++) {
-  const answer = answers[i]
-  answer.classList.toggle('opened');}
+  question.nextElementSibling.classList.toggle('opened');
 }
 
+
+// function toggleFaq(event) {
+//   console.log(event);
+//   for (let i = 0; i < answers.length; i++) {
+//   const answer = answers[i]
+//   answer.classList.toggle('opened');}
+
+// }
+
+// /////////////////
+
+// document.addEventListener('click', function(e) {
+//   if (e.target.classList.contains('rect_white_left') {
+//     e.target.parentNode.nextElementSibling...
+//   }
+// });
+ 
+///////////////////
+
+// document.addEventListener('click', function(e) {
+//   if (e.target.classList.contains('rect_white_left') {
+//     e.target.parentNode.nextElementSibling.classList.toggle('opened');}
+//   }
+
+
 // fonction pour attribuer la class du parents
 
 // var fields = document.getElementsByClassName("field--name-field-titre");

+ 0 - 0
web/themes/custom/eql/scss/pages/_offreDeService.scss