1.0.5 • Published 8 years ago

sticky-scroll v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Sticky Scroll

JavaScript module for sticking elements to the top of the page on scroll once they reach the top of the window, supports offset from the top of the page.

Instructions

Browserify

var StickyScroll = require('sticky-scroll')
var stickyScroll = new StickyScroll('#top')

Customisable offset

var stickyScroll = StickyScroll('#top', 120)

Second argument is the number of offset pixels from the top of the browser window.

Browser Usage

  1. Add Markup

    <div id="top">
    	<!-- Sticky content -->
    </div>
  2. Link JavaScript and trigger script

    <!-- Put this right before the </body> closing tag -->
    <script src="sticky-scroll.js"></script>
    <script>
    	var stickyScroll = StickyScroll('#top')
    </script>

Licence

Licensed under the MIT Licence

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago