# floor-navigation

> > Thanks to [Floornav](https://github.com/athm-fe/floornav)

Latest version **1.0.3** (published 2020-02-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install floor-navigation
pnpm add floor-navigation
yarn add floor-navigation
bun add floor-navigation
```

## 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.0.3 |
| Published | 2020-02-14 |
| First published | 2020-02-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liihom |
| Maintainers | liihom |
| Keywords | typescript, javascript, nav |

## Links

- npm: https://www.npmjs.com/package/floor-navigation
- Repository: https://github.com/liihom/floor-navigation
- Homepage: https://github.com/liihom/floor-navigation#readme
- Issues: https://github.com/liihom/floor-navigation/issues
- npm.io page: https://npm.io/package/floor-navigation

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-02-14
- 1.0.2 — 2020-02-14
- 1.0.0 — 2020-02-13

## README

## Floor navigation

> Thanks to [Floornav](https://github.com/athm-fe/floornav)

A floor navigation component based on typescript and vanilla js.

### HTML

``` html
<div id="floornav">
  <a href="#floor1">1楼</a>
  <a href="#floor2">2楼</a>
  <a href="#floor3">3楼</a>
  <a href="#floor4">4楼</a>
  <a href="#floor5">5楼</a>
  <a href="#floor6">6楼</a>
</div>

<div class="floor">占位</div>
<div id="floor1" class="floor">这是1楼</div>
<div id="floor2" class="floor">这是2楼</div>
<div id="floor3" class="floor">这是3楼</div>
<div id="floor4" class="floor">这是4楼</div>
<div id="floor5" class="floor">这是5楼</div>
<div id="floor6" class="floor">这是6楼</div>
<div class="floor">占位</div>
```

### Usage

Please write the style yourself.

install [`floor-navigation npm`](https://www.npmjs.com/package/floor-navigation).

``` bash
npm i floor-navigation --save
```

import floor-navigation.

``` js
import Floornav from 'floor-navigation';

new Floornav({
  id: 'floornav',
  base: 'top',
  isToggleShow: false,
  ...
});
```

### The API

#### Options

| key | description  | default | options|
| :------------ |:---------------|:-----|:----|
| `id` | the id of the floor element | `undefined` | `string` |
| `container` | scroll container | `window` | `window` / `string` |
| `base`      | baseline  |   0 | `top`/ `center`/ `bottom` |
| `threshold` | threshold  |  0 | `number` |
| `scrollOffset` | the offset from baseline |   0 | `number` |
| `activeClass` | the active class of the current floor item  | `active` | `string`  |
| `showClass` |  class at the floor display      |   `show` | `string` |
| `isToggleShow` | Whether the floor disappears with the content  | `true` | `boolean` |
| `navActiveCallback` | the navigation active callback | -- | `function` |

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