function debounce(f, ms) {
let isRunning = false;
return function() {
if (isRunning) return;
f.apply(this, arguments);
isRunning = true;
setTimeout(() => isRunning = false, ms);
};
}
const debouncedMyFunction = debounce(menuHover, 2000);
function correctHeightMenu(height, y) {
$('#209718f4-8400-401d-a616-9240ede2e9de')
.children()
.eq(1)
.siblings()
.animate({
height: height,
y: y
}, 300);
}
var menu = $('.js-toggle-menu');
var menuHover = menu.hover(
function () {
correctHeightMenu(40, 0)
},
function () {
correctHeightMenu(26, 14)
}
)