fixed-landmark

1.2.1 • Public • Published

Fixed Landmark

A library for fixing elements within a container.

LIVE DEMO

Example initialization

window.addEventListener("load",function(){
 
  // EXAMPLE 1 - FIX AN ELEMENT TO A CONTAINER
  new FixedElement({
    element   : "#fixed-element-1",
    container : "#container-1"
  });
 
  // EXAMPLE 2 - FIX ELEMENT TO BODY
  new FixedElement({
    element   : 'nav',
    container : 'body'
  });
 
 
  new FixedElement({
    // AVAILABLE OPTIONS
 
    // element : String selector | DOMElement
    // container : String selector | DOMElement
    // offsetElement : String selector | DOMElement
    // offsetValue : int
    // offsetFunction : function
    // - Parameter: this
    // - Parameter: int offset
    // - Expected return value: int
 
  });
 
});

Package Sidebar

Install

npm i fixed-landmark

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

27 kB

Total Files

8

Last publish

Collaborators

  • gasparerro