-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
26 lines (22 loc) · 1.01 KB
/
script.js
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
document.addEventListener('DOMContentLoaded', function () {
const menuIcon = document.getElementById('menu-icon');
const navbar = document.querySelector('.navbar');
menuIcon.addEventListener('click', () => {
navbar.classList.toggle('active');
});
document.addEventListener('click', (event) => {
if (!navbar.contains(event.target) && !menuIcon.contains(event.target)) {
navbar.classList.remove('active');
}
});
});
document.addEventListener('DOMContentLoaded', function () {
const readMoreButtons = document.querySelectorAll('.readMoreBtn');
readMoreButtons.forEach(button => {
button.addEventListener('click', function () {
const moreContent = this.nextElementSibling;
moreContent.style.display = moreContent.style.display === 'none' ? 'block' : 'none';
this.textContent = moreContent.style.display === 'none' ? 'Read More' : 'Read Less';
});
});
});