Stick Element To Bottom Of Its Parent - fixedElemScroll

File Size: 5.56 KB
Views Total: 450
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Stick Element To Bottom Of Its Parent - fixedElemScroll

fixedElemScroll is a tiny and cross-browser jQuery Sticky plugin that makes an element always stay at the bottom of the page until you scroll past its parent container.

Great for sticky sidebar, floating social sharing bar, fixed bottom ads, and much more.

How to use it:

1. Load the fixedElemScroll.jquery.js script after jQuery.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/fixedElemScroll.jquery.js"></script>

2. Make an element always visible within its parent container.

<section>
  <div class="fixed-elem"></div>
</section>
$(function(){
  $('.fixed-elem').fixedElemScroll();
});

3. Fix the position of the element relative to another container.

$(function(){
  $('.fixed-elem').fixedElemScroll({
    $parent: $this.parent(),
  });
});

4. Set the distance from the bottom of the parent container when the element gets stuck. Default: 0.

$(function(){
  $('.fixed-elem').fixedElemScroll({
    bottom: 20
  });
});

This awesome jQuery plugin is developed by delibash. For more Advanced Usages, please check the demo page or visit the official website.