1

Hey I want to show a Navigationbar after my user scroll down about 200px.

For now I found this solution. And it works like a charm. But I doesn't fount anything how to get the scroll position.

Maybe you can help me here. Maybe the event has the position but I don't found it in the developer console.

Thanks in advance Dominic

Community
  • 1
  • 1
dominic
  • 385
  • 1
  • 6
  • 23

1 Answers1

0

After searching further I found this one here.

I now have a Method looking like:

 @HostListener('window:scroll', ['$event'])
  showNavbar(event): void {
    console.log("Scrolling" + document.body.scrollTop);
  }

This one seemes to work verry well.

Community
  • 1
  • 1
dominic
  • 385
  • 1
  • 6
  • 23