cheersmas / Two-direction-Sticky-Sidebar

Sample two direction Sticky Sidebar with Pure JavaScript for any project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two-direction-Sticky-Sidebar

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. enter image description here 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.

Example of use

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">

A working example on JSFiddle

Download

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

Support

If you found a bug or would like to contribute to the development, please contact me: krzysztof@antosik.dev

About

Sample two direction Sticky Sidebar with Pure JavaScript for any project

License:MIT License


Languages

Language:JavaScript 65.4%Language:HTML 25.5%Language:CSS 9.1%