1.0.8 • Published 10 years ago

keep-fixed-between v1.0.8

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

Keep fixed between

This is a simple, lightweight, dependency free library that helps you create position sticky like effect. It works in any browser (even IE) and does not need to be wrapped in a div.

Pros

  • Dependency free
  • Easy to use
  • Easy to customize

Examples

First

Installation

With NPM

npm install keep-fixed-between

With Bower

bower install keep-fixed-between

How to use it?

It's really simple

window.onload = function () {
    keepFixedBetween({
        fixedElement: "#fixed",
        topElement: "#topElement",
        bottomElement: "#bottomElement"
    });
};

Parameters

  • fixedElement (required) - element to move, with fixed position
  • topElement (required) - top element, fixed element will not go over it
  • bottomElement (required) - bottom element, fixed element will not go under it
  • topMargin (optional) - margin in pixels between top element and fixed element
  • bottomMargin (optional) - margin in pixels between bottom element and fixed element

Changelog

  • Get rid of removeAttribute('style') usage - v1.0.3
  • Adjustable margin for fixed element - v1.0.5
  • Gulp minify task - v1.0.6
  • Margin bug fix - v1.0.8

To do

  • Empty for now

License

The library is open-sourced software licensed under the MIT license.

1.0.8

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago