# fixed-landmark

> A library for fixing elements to a container within a container.

Latest version **1.2.1** (published 2019-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install fixed-landmark
pnpm add fixed-landmark
yarn add fixed-landmark
bun add fixed-landmark
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-12-10 |
| First published | 2019-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gaspar G. Errobidart |
| Maintainers | gasparerro |
| Keywords | fixed, element, js, browser, scrollspy, scroll |

## Links

- npm: https://www.npmjs.com/package/fixed-landmark
- Repository: https://github.com/GasparErrobidart/fixed-landmark
- Homepage: https://github.com/GasparErrobidart/fixed-landmark#readme
- Issues: https://github.com/GasparErrobidart/fixed-landmark/issues
- npm.io page: https://npm.io/package/fixed-landmark

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.1 (latest) — 2019-12-10
- 1.2.0 — 2019-11-29
- 1.1.5 — 2019-11-28
- 1.1.3 — 2019-11-27
- 1.1.2 — 2019-11-26
- 1.1.0 — 2019-11-25
- 1.0.0 — 2019-11-25

## README

# Fixed Landmark
A library for fixing elements within a container.

[LIVE DEMO](https://codepen.io/gasparerr/pen/GRRLYwp?editors=1010)

## Example initialization
```javascript
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

  });

});
```

---
_Source: https://npm.io/package/fixed-landmark · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
