1.1.7 • Published 5 months ago

pretty-scroll v1.1.7

Weekly downloads
251
License
appleple
Repository
-
Last release
5 months ago

Pretty Scroll

A library to make an element follow you as you scroll

Demos

Installation

via npm

npm install pretty-scroll --save

or yarn

yarn add pretty-scroll

Basic

<div class="js-container">
  <div class="main">
  </div>
  <div class="sub">
    <div class="js-sidebar">
      <!-- contents here -->
    </div>
  </div>
</div>
new PrettyScroll('.js-sidebar', {
  container: '.js-container',
  breakpoint: 575, // stop running the js when the window size is smaller than 575px
  offsetTop: 20, // space between the sticky element and the top of the window
  offsetBottom: 20, // space between the sticky element and the bottom of the window
  condition: () => true // you can disable the sticky behavior by returning false, it will be executed when you scroll.
});
1.1.7

5 months ago

1.1.6

5 months ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago