Dantes (обсуждение | вклад) Нет описания правки Метка: ручная отмена |
Dantes (обсуждение | вклад) Нет описания правки Метка: ручная отмена |
||
| Строка 1: | Строка 1: | ||
document. | document.querySelectorAll('.recipe-list li').forEach(function(item) { | ||
if (item.classList.contains('instruction')) return; | |||
if (item === item.parentElement.lastElementChild) return; | |||
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'); | |||
}; | |||
} | |||
}); | }); | ||
Версия от 05:23, 8 мая 2025
document.querySelectorAll('.recipe-list li').forEach(function(item) {
if (item.classList.contains('instruction')) return;
if (item === item.parentElement.lastElementChild) return;
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');
});