Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
// | // Анимация раскрытия контента | ||
$('.collapsible-header').click(function () { | $('.collapsible-header').click(function () { | ||
var content = $(this).next('.collapsible-content'); | var content = $(this).next('.collapsible-content'); | ||
content.slideToggle(300) | content.slideToggle(300, function() { | ||
$(this).toggleClass('open'); | // Анимация появления элементов после раскрытия | ||
$(this).find('li').each(function (index) { | |||
$(this).css('animation-delay', (index * 0.1) + 's'); | |||
$(this).addClass('visible'); | |||
}); | |||
}); | |||
$(this).toggleClass('open'); | |||
}); | }); | ||
// | // Устанавливаем цвет границы из data-атрибута | ||
$('.recipe-card').each(function () { | $('.recipe-card').each(function () { | ||
var borderColor = $(this).attr('data-border'); | var borderColor = $(this).attr('data-border'); | ||
Версия от 03:12, 3 мая 2025
$(document).ready(function () {
// Анимация раскрытия контента
$('.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');
$(this).addClass('visible');
});
});
$(this).toggleClass('open');
});
// Устанавливаем цвет границы из data-атрибута
$('.recipe-card').each(function () {
var borderColor = $(this).attr('data-border');
if (borderColor) {
$(this).css('border-color', borderColor);
}
});
});