-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (32 loc) · 1.22 KB
/
script.js
File metadata and controls
37 lines (32 loc) · 1.22 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
function copyToClipboard(text) {
var tempInput = document.createElement("input");
tempInput.value = text;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
// Показать уведомление
showCopyNotification();
}
function showCopyNotification() {
var notification = document.getElementById("copyNotification");
notification.style.display = "block";
// Скрыть уведомление через 3 секунды
setTimeout(function() {
notification.style.display = "none";
}, 3000);
}
//шо ты тут делаешь? не лезб! оно тебя сожрёт!!!
document.addEventListener('DOMContentLoaded', function() {
const faqItems = document.querySelectorAll('.faq-question');
faqItems.forEach(item => {
item.addEventListener('click', function() {
const answer = this.nextElementSibling;
if (answer.style.maxHeight) {
answer.style.maxHeight = null;
} else {
answer.style.maxHeight = answer.scrollHeight + 'px';
}
});
});
});