Sample two direction Sticky Sidebar with Pure JavaScript for any project
A short javascript code that allows you to quickly and easily implement Sticky Sidebar, which will scroll depending on which page the user scrolls to. And everything with the use of pure javascript, thanks to which you will save redundant code and gain efficiency. source of the original picture
I wrote code to use in my own project. All ready-made solutions used jQuery or had a lot of unnecessary code. I share it because it may be useful to someone. I allow it to be freely modified. Perhaps I will extend the script in the future.
To use a script, just add the attribute to our sidebar: data-sticky="true"
. Only one element can be used so far.
Example:
<aside data-sticky="true">
To download, just follow the link: Download or enter the command in the terminal:
$ git clone https://github.com/Antosik-dev/Two-direction-Sticky-Sidebar.git
If you found a bug or would like to contribute to the development, please contact me: [email protected]