npm.io
1.2.1 • Published 6 years ago

fixed-landmark

Licence
MIT
Version
1.2.1
Deps
0
Size
26 kB
Vulns
0
Weekly
0

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

  });

});

Keywords