A JavaScript plugin for making smart and high performance.
npm install sticky-sidebarsticky-sidebar.js file in your project folder.
#### Bower
If you are using bower as package manager:
``
bower install sticky-sidebar
``
#### NPM
If you are using NPM as package manager:
``
npm install sticky-sidebar
``
Usage
Your website's html structure has to be similer to this in order to work:
``html
``
Note that inner sidebar wrapper .sidebar__innner is optional but highly recommended, if you don't write it yourself, the script will create one for you under class name inner-wrapper-sticky. but this may cause many problems.
For the above example, you can use the following JavaScript:
``html
``
#### Via jQuery/Zepto
You can configure sticky sidebar as a jQuery plugin, just include jquery.sticky-sidebar.js instead sticky-sidebar.js file than configure it as any jQuery plugin.
``html
``
Make sure to include sticky-sidebar.js script file after jquery.js.
Usage with ResizeSensor.js
Sticky sidebar integrated with ResizeSensor.js to detect when sidebar or container is changed. To use resize sensor with this plugin just make sure to include ResizeSensor.js before sticky-sidebar.js code whether through module loader, bundle or event inclusion as a