-
Notifications
You must be signed in to change notification settings - Fork 0
/
faq code
63 lines (53 loc) · 1.63 KB
/
faq code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<div class="shopify_explorer__content">
<h3 class="faq_heading ">{{ section.settings.heading | escape }}</h3>
{%- for block in section.blocks -%}
<div class="shopify_explorer_faq__item" {{ block.shopify_attributes }}>
<h3 class="shopify_explorer_faq__question h5"><div class="faq-icons"><svg class="faq-icon" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path class="faq-icon-minus" fill="currentColor" d="M8 0v14H6V0z"></path>
<path fill="currentColor" d="M0 6h14v2H0z"></path>
</svg></div>{{ block.settings.question }}</h3>
<div class="shopify_explorer_faq__answer rte">
{{ block.settings.answer }}
</div>
</div>
{%- endfor -%}
</div>
{% schema %}
{
"name": "FAQs",
"settings": [
{
"type": "text",
"id": "heading",
"label": "Heading"
}
],
"blocks": [
{
"type": "question",
"name": "Question",
"settings": [
{
"type": "text",
"id": "question",
"label": "Question"
},
{
"type": "richtext",
"id": "answer",
"label": "Answer"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(".shopify_explorer_faq__question").click(function() {
$(this).toggleClass('acc_open');
$(this).next('.shopify_explorer_faq__answer').slideToggle(300);
});
</script>