Skip to content

Sample two direction Sticky Sidebar with Pure JavaScript for any project

License

Notifications You must be signed in to change notification settings

cheersmas/Two-direction-Sticky-Sidebar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: [email protected]

About

Sample two direction Sticky Sidebar with Pure JavaScript for any project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.4%
  • HTML 25.5%
  • CSS 9.1%