|
|
| Строка 1: |
Строка 1: |
| document.querySelectorAll('.recipe-list li').forEach(function(item) { | | document.querySelector('.dropdown-button').addEventListener('click', function() { |
| if (item.classList.contains('instruction')) return;
| | var dropdown = document.querySelector('.dropdown'); |
| if (item === item.parentElement.lastElementChild) return;
| | dropdown.classList.toggle('open'); |
| if (item.querySelector('.chem-icon')) return;
| |
| | |
| var icon = document.createElement('img');
| |
| icon.className = 'chem-icon';
| |
| icon.src = 'Beaker.png';
| |
| item.insertBefore(icon, item.firstChild);
| |
| });
| |
| | |
| $('.collapsible-header').click(function() {
| |
| var content = $(this).next('.collapsible-content');
| |
| content.slideToggle(300, function() {
| |
| $(this).find('li').each(function(index) { | |
| $(this).css('animation-delay', (index * 0.1) + 's')
| |
| .toggleClass('visible', $(this).is(':visible'));
| |
| });
| |
| }).toggleClass('active');
| |
| }); | | }); |
Версия от 09:26, 8 мая 2025
document.querySelector('.dropdown-button').addEventListener('click', function() {
var dropdown = document.querySelector('.dropdown');
dropdown.classList.toggle('open');
});