ponozky/assets/script.js

14 lines
541 B
JavaScript
Raw Normal View History

2024-06-09 16:24:41 +02:00
document.addEventListener('DOMContentLoaded', function() {
const toggleBtn = document.getElementById('toggle_btn');
const toggleBtnIcon = document.getElementById('toggle_btn_icon');
const dropDownMenu = document.getElementById('dropdown_menu');
toggleBtn.addEventListener('click', function() {
dropDownMenu.classList.toggle('open');
const isOpen = dropDownMenu.classList.contains('open');
toggleBtnIcon.classList = isOpen
? 'ri-close-line'
: 'ri-menu-line';
}, false);
}, false);