All Projects → abouolia → Sticky Sidebar

abouolia / Sticky Sidebar

Licence: mit
😎 Pure JavaScript tool for making smart and high performance sticky sidebar.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Sticky Sidebar

Animatescroll.js
A Simple jQuery Plugin for Animating Scroll
Stars: ✭ 708 (-65.58%)
Mutual labels:  jquery-plugin, scrolling, jquery
Paroller.js
Parallax scrolling jQuery plugin
Stars: ✭ 535 (-73.99%)
Mutual labels:  jquery-plugin, scrolling, jquery
Jquery Lockfixed
jQuery lockfixed plugin
Stars: ✭ 69 (-96.65%)
Mutual labels:  jquery-plugin, scrolling, jquery
Bootstrap Fileinput
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
Stars: ✭ 5,097 (+147.79%)
Mutual labels:  bower, jquery-plugin, jquery
Jquery Scrolllock
Locks mouse wheel scroll inside container, preventing it from propagating to parent element
Stars: ✭ 109 (-94.7%)
Mutual labels:  jquery-plugin, scrolling, jquery
Jquery Scrollstop
A jQuery plugin that fires events when scrolling stops and starts.
Stars: ✭ 158 (-92.32%)
Mutual labels:  jquery-plugin, jquery
Jquery Confirm
A multipurpose plugin for alert, confirm & dialog, with extended features.
Stars: ✭ 1,776 (-13.66%)
Mutual labels:  jquery-plugin, jquery
Convform
A jQuery plugin that transforms a form into an interactive chat.
Stars: ✭ 141 (-93.15%)
Mutual labels:  jquery-plugin, jquery
Metismenu
Related projects
Stars: ✭ 1,904 (-7.44%)
Mutual labels:  jquery-plugin, jquery
Fotorama
A simple, stunning, powerful jQuery gallery.
Stars: ✭ 1,567 (-23.82%)
Mutual labels:  jquery-plugin, jquery
Jquery Menu Editor
Multilevel Menu Editor for Bootstrap 4.x (Html & Javascript code)
Stars: ✭ 144 (-93%)
Mutual labels:  jquery-plugin, jquery
Stickyfloat
This plugin makes it possible to have a fixed position element that is relative to it’s parent. A normal fixed positioned element would be “out of context” and is very difficult to use in the most common situations with fluid designs. This plugin solves that problem with as little code as I could possible get it so it will run in the most optimized way, while also allow you to customize it in many important ways which might suit you best.
Stars: ✭ 166 (-91.93%)
Mutual labels:  jquery-plugin, jquery
Slide And Swipe Menu
⚡️ A sliding swipe menu that works with touchSwipe library.
Stars: ✭ 135 (-93.44%)
Mutual labels:  jquery-plugin, jquery
Jquery.fbmessenger
Fake Facebook Messenger interactions on an iPhone with a simple jQuery plugin!
Stars: ✭ 130 (-93.68%)
Mutual labels:  jquery-plugin, jquery
Balancedgallery
A balanced photo gallery plugin for jQuery.
Stars: ✭ 158 (-92.32%)
Mutual labels:  jquery-plugin, jquery
Checkboxes.js
☑️ A jQuery plugin that gives you nice powers over your checkboxes.
Stars: ✭ 127 (-93.83%)
Mutual labels:  jquery-plugin, jquery
Jquery jeditable
jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
Stars: ✭ 1,756 (-14.63%)
Mutual labels:  jquery-plugin, jquery
Jquery Connections
Add stylable lines connecting page elements. ⮑ Handy for visualizing relations and graph edges. ⮐
Stars: ✭ 151 (-92.66%)
Mutual labels:  jquery-plugin, jquery
Jquery.serializeobject
Encode a set of form elements as a JSON object for manipulation/submission.
Stars: ✭ 149 (-92.76%)
Mutual labels:  jquery-plugin, jquery
Magnificent.js
🔍 Zoom responsively, images & more, w/ jQuery.
Stars: ✭ 153 (-92.56%)
Mutual labels:  jquery-plugin, jquery

Sticky Sidebar Build Status

Pure JavaScript plugin for making smart and high performance sticky sidebars.

Basic Example

Scrollable Sticky Element

For complete documentation and examples see abouolia.github.com/sticky-sidebar

Why is sticky sidebar so awesome?

  • It does not re-calculate all dimensions when scrolling, just necessary dimensions.
  • Super smooth without incurring scroll lag or jank and no page reflows.
  • Integrated with resize sensor to re-calculate all dimenstions of the plugin when size of sidebar or its container is changed.
  • It has event trigger on each affix type to hook your code under particular situation.
  • Handle the sidebar when is tall or too short compared to the rest of the container.
  • Zero dependencies and super simple to setup.

Install

You can download sticky sidebar jQuery plugin from Bowser, NPM or just simply download it from this page and link to the sticky-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 similar to this in order to work:

<div class="main-content">
    <div class="sidebar">
        <div class="sidebar__inner">
            <!-- Content goes here -->
        </div>
    </div>
    <div class="content">
        <!-- Content goes here -->
    </div>
</div>

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:

<script type="text/javascript" src="./js/sticky-sidebar.js"></script>

<script type="text/javascript">
  var sidebar = new StickySidebar('.sidebar', {
    topSpacing: 20,
    bottomSpacing: 20,
    containerSelector: '.main-content',
    innerWrapperSelector: '.sidebar__inner'
  });
</script>

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.

<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript" src="./js/jquery.sticky-sidebar.js"></script>

<script type="text/javascript">
  $('#sidebar').stickySidebar({
    topSpacing: 60,
    bottomSpacing: 60
  });
</script>

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 <script> and enable resizeSensor option (enabled by default) and it will works.

You can choose not to include ResizeSensor.js and sticky sidebar will continue work without any problem but without automatically detect resize changes.

Browser Support

Sticky sidebar works in all modern browsers including Internet Explorer 9 and above, but if you want it to work with IE9, should include requestAnimationFrame polyfill before sticky sidebar code.

If you have any issues with browser compatibility don’t hesitate to Submit an issue.

License

Sticky Sidebar is released under the MIT license. Have at it.


Made by Ahmed Bouhuolia

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].