Modulo para mover el scroll suave hasta centrar un elemento en pantalla
🏠 Homepage
- node >=10.16.3
npm i @eclass/scrollmovenpm run testgoTo() receives two parameters id and options
importgoTofrom'@eclass/scrollmove'
...
<ComponentonClick={()=>goTo(`#question-98765`)}>
/>importgoTofrom'@eclass/scrollmove'
...
<ComponentonClick={()=>goTo(`#question-98765`,{behavior: 'smooth',block: 'center'})}>
/>- id: string, that identifies the element in the dom.
- options: object, with the properties
behavior,blockandinline. Default is set{ behavior: 'smooth', block: 'center' }.
More options from api of scrollIntoView
👤 Ender Bonnet
Copyright © 2019 Ender Bonnet enbonnet@pm.me (https://enbonnet.me/).
This project is MIT licensed.