Hi, in the project I am, we select an element from a list that can be in any place (bot, top, middle) and the app redirects to a section where all the elements are displayed with a detail section. I need to set the scroll to this element so it is seen at the top no matter where it is in the list.
My idea is to create an event that the perfect-scrollbar looks for this element, can be by a class (?) and sets the element to the top.
Hi there,
pefect-scrollbar aims to not change default scrolling behaviour. This means that the way you would achieve this with a native browser scrollbar is the same way you'd achieve it with perfect-scrollbar.
This means you don't need a custom function, but could it achieve it a similar way as shown in this JSFiddle. I hope that addresses your issue. Feel free to re-open if you need further help.
if you use angular you can check out ngx-perfect-scrollbar
They have this method
scrollToElement(qs, offset?, speed?) // Animate scroll to element matching query selectors.
Most helpful comment
if you use angular you can check out ngx-perfect-scrollbar
They have this method
scrollToElement(qs, offset?, speed?) // Animate scroll to element matching query selectors.