0

simple issue here: I'm building a website using the awesome Black Dashboard template for Bootstrap 4 (https://www.creative-tim.com/product/black-dashboard - thanks Tim!). The template employs PerfectScrollbar for jQuery, with which I have no prior experience. I would very much like the menu items on my website to scroll to specific point at the homepage rather than to link to other pages, but for the life of me I can't figure out how to scroll to a desired element with PerfectScrollbar, and removing PS causes some issues with overflow of tables. I have tried the jQuery way, the pure JS way, even old-school anchors, as well as updating scrollTop, as recommended by PS docs. Nothing works. There are no JS errors, simply nothing happens.

PaulJK
  • 189
  • 11

1 Answers1

3

As far as I know, you can't do this with perfect scrollbar, but you can do simply

htmlElement.scrollIntoView()

If you are on angular, you can use ElementRef

elementRef.nativeElement.scrollIntoView();
Sajeer Babu
  • 1,103
  • 1
  • 9
  • 13