Skip to content
Snippets Groups Projects
Commit f9915738 authored by druid's avatar druid
Browse files

fadeout timer

parent d9692a58
No related branches found
No related tags found
No related merge requests found
......@@ -188,11 +188,13 @@ export class HyDesktopMenuLinks {
item.classList.remove('hy-desktop-menu-panel--is-active');
item.setAttribute('aria-hidden', 'true');
});
}, 2500);
}, 350);
} else {
menuPanelItems.forEach((item) => {
item.classList.remove('hy-desktop-menu-panel--is-active');
item.setAttribute('aria-hidden', 'true');
(item as HTMLElement).style.opacity = '0';
(item as HTMLElement).style.transition = 'none';
});
}
}
......@@ -212,6 +214,8 @@ export class HyDesktopMenuLinks {
}
handleDesktopMenuEnter(event, id) {
clearTimeout(this._fadeOutTimer);
this._hoverTimer = setTimeout(() => {
const activeMenuItem = this.el.shadowRoot.querySelector(`.desktop-menu-link[link-id="${id}"]`) as HTMLElement;
......
......@@ -108,12 +108,9 @@ export class SiteHeader {
this.el.children[0].setAttribute('menu-language-label-close', this.languageLabels['close']);
this.el.children[0].setAttribute('label-front-page', this.menuLabels['front_page']);
//this.intervalId = setInterval(this.timer, 250);
//clearInterval(this.intervalId);
this.intervalId = setInterval(() => {
this.timer();
}, 250);
//console.log('willUpdate ' + this.intervalId);
}
timer() {
......@@ -133,7 +130,6 @@ export class SiteHeader {
// If current position > last position AND scrolled past navbar...
if (st > this.lastScrollTop && st > this.navbarHeight) {
// Scroll Down
console.log('scroll down');
hySiteHeader.classList.add('hy-site-header--sticky-active');
hySiteHeader.classList.add('hy-site-header--sticky-hidden');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment