Repository navigation
Expand file tree
/
Copy pathsimple-faq.html
More file actions
executable file
·88 lines (80 loc) · 3.04 KB
/
Copy pathsimple-faq.html
File metadata and controls
executable file
·88 lines (80 loc) · 3.04 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<base href="https://fm.dev.lan/">
<title>HTML Simple FAQ 1.0.2</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="template/images/favicon/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="template/images/favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png">
<link href="template/images/favicon/favicon-64x64.png" rel="icon" sizes="64x64" type="image/png">
<link href="template/css/main.css?v=0" rel="stylesheet">
<link href="template/css/fonts.css" rel="stylesheet">
<link href="template/css/font-awesome.min.css" rel="stylesheet">
<script src="template/js/jquery.min.js"></script>
<!-- Old accordion script commented out -->
<!--
<script>
// Аккрдион
$(function() {
if ($('.faq-header').length > 0) {
let active = 'active';
$('.faq-header').on('click',function () {
$(this).toggleClass(active);
$(this).next('.faq-content').slideToggle(200);
return false;
});
};
});
</script>
-->
<script>
$(function() {
if ($('.faq-header').length > 0) {
$('.faq-header').on('click', function () {
const $clickedHeader = $(this);
const $clickedContent = $clickedHeader.next('.faq-content');
const isCurrentlyActive = $clickedHeader.hasClass('active');
// Close all FAQ items
$('.faq-header').removeClass('active');
$('.faq-content').slideUp(200);
// If the clicked header wasn't active before, open it
if (!isCurrentlyActive) {
$clickedHeader.addClass('active');
$clickedContent.slideDown(200);
} else {
// If it was already active, just remove the active class (since we closed all above)
$clickedHeader.removeClass('active');
}
return false;
});
};
});
</script>
</head>
<body>
<!-- FAQ Аккордеон -->
<div class="container indent-middle pages">
<div class="faq">
<div class="faq-item">
<h3 class="faq-header">Публичная власть</h3>
<div class="faq-content">
<p>Публичная власть распространяется не только на тех, кто прямо или косвенно (например, пойдя на выборы) дал согласие ей подчиняться, а на всех, кто проживает на некой территории.</p>
</div>
</div>
<div class="faq-item">
<h3 class="faq-header">Другой вопрос</h3>
<div class="faq-content">
<p>Это другой вопрос для демонстрации работы аккордеона с несколькими элементами.</p>
</div>
</div>
<div class="faq-item">
<h3 class="faq-header">Третий вопрос</h3>
<div class="faq-content">
<p>Это третий вопрос для демонстрации работы аккордеона с несколькими элементами.</p>
</div>
</div>
</div>
</div>
</body>
</html>