{% extends 'index/layout.html.twig' %}
{% block page_name %}faq{% endblock %}
{% block title -%}よくある質問{%- endblock %}
{% block header_title %}よくある質問{% endblock %}
{% block stylesheet %}
<link rel="stylesheet" href="../css/faq.css">
{% endblock %}
{% block main %}
<main>
{% for questionCategory in questionCategories %}
<h2 class="page_title">{{ questionCategory.name }}</h2>
<ul class="faq_list">
{% for question in questionCategory.questions %}
<li class="faq_item">
<h3 class="question" data-type="Q">{{ question.title }}</h3>
<div class="answer" data-type="A">
<p>{{ question.content | nl2br }}</p>
</div>
</li>
{% endfor %}
</ul>
{% endfor %}
</main>
{% endblock %}
{% block js %}
<script>
$(function(){
$('.faq_item .answer').hide();
$('.faq_item .question').on("click",function (){
$(this).parent().toggleClass('active');
$(this).next('.answer').slideToggle();
return false;
})
var hash = location.hash;
if (hash){
var $hash = $(hash).find('.answer').slideToggle();
setTimeout(function(){
// 繧「繧ウ繝シ繝�ぅ繧ェ繝ウ髢矩哩蠕後↓蜀榊コヲ繧ケ繧ッ繝ュ繝シ繝ォ
var position = $(hash).offset().top;
$('body,html').animate({scrollTop:position}, 0, 'swing');
}, 50);
}
})
</script>
{% endblock %}