Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 969 Bytes

File metadata and controls

41 lines (28 loc) · 969 Bytes

Sticky horizontal scroll jQuery plugin

Usage

$('body').stickyHScroll();

With Bootstrap responsive table

<div class="table-responsive sticky-hscroll">
  <table class="table">
    ...
  </table>
</div>

With other

<style>
  .sticky-hscroll {
    overflow-x: auto;
  }
</style>

<div class="sticky-hscroll">
  <div>
    <p>Lorem Ipsum is simply...</p>
  </div>
</div>

Demo

Demo

Install

If you're using npm to manage your frontend dependencies you can install this plugin by just issuing this command:

npm install --save sticky-hscroll

Otherwise you can just download src/sticky-hscroll.js, put it wherever you usually put JavaScripts in your project and include it on pages where you want to have sticky horizontal scrolls:

<script src="proxy.php?url=https%3A%2F%2Fgithub.com%2Fpath%2Fto%2Fjavascripts%2Fsticky-hscroll.js" type="text/javascript"></script>

Enjoy!