templates/index/faq.html.twig line 1

Open in your IDE?
  1. {% extends 'index/layout.html.twig' %}
  2. {% block page_name %}faq{% endblock %}
  3. {% block title -%}よくある質問{%- endblock %}
  4. {% block header_title %}よくある質問{% endblock %}
  5. {% block stylesheet %}
  6.     <link rel="stylesheet" href="../css/faq.css">
  7. {% endblock %}
  8. {% block main %}
  9.     <main>
  10.         {% for questionCategory in questionCategories %}
  11.         <h2 class="page_title">{{ questionCategory.name }}</h2>
  12.         <ul class="faq_list">
  13.             {% for question in questionCategory.questions %}
  14.             <li class="faq_item">
  15.                 <h3 class="question" data-type="Q">{{ question.title }}</h3>
  16.                 <div class="answer" data-type="A">
  17.                     <p>{{ question.content | nl2br }}</p>
  18.                 </div>
  19.             </li>
  20.             {% endfor %}
  21.         </ul>
  22.         {% endfor %}
  23.     </main>
  24. {% endblock %}
  25. {% block js %}
  26.     <script>
  27.         $(function(){
  28.             $('.faq_item .answer').hide();
  29.             $('.faq_item .question').on("click",function (){
  30.                 $(this).parent().toggleClass('active');
  31.                 $(this).next('.answer').slideToggle();
  32.                 return false;
  33.             })
  34.             var hash = location.hash;
  35.             if (hash){
  36.                 var $hash = $(hash).find('.answer').slideToggle();
  37.                 setTimeout(function(){
  38.                     // 繧「繧ウ繝シ繝�ぅ繧ェ繝ウ髢矩哩蠕後↓蜀榊コヲ繧ケ繧ッ繝ュ繝シ繝ォ
  39.                     var position = $(hash).offset().top;
  40.                     $('body,html').animate({scrollTop:position}, 0, 'swing');
  41.                 }, 50);
  42.             }
  43.         })
  44.     </script>
  45. {% endblock %}