# libj-window-scrollbar

> This is used to __`remove`__ window's scrollbar temporarily and __`restore`__ it again

Latest version **1.1.0** (published 2019-08-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install libj-window-scrollbar
pnpm add libj-window-scrollbar
yarn add libj-window-scrollbar
bun add libj-window-scrollbar
```

## 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.1.0 |
| Published | 2019-08-15 |
| First published | 2019-08-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 52.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | saeidfarahi |

## Links

- npm: https://www.npmjs.com/package/libj-window-scrollbar
- Repository: https://saeidfarahi@dev.azure.com/saeidfarahi/libj-window-scrollbar/_git/libj-window-scrollbar
- npm.io page: https://npm.io/package/libj-window-scrollbar

## Recent versions

- 1.1.0 (latest) — 2019-08-15
- 1.0.4 — 2019-08-10
- 1.0.3 — 2019-08-10
- 1.0.2 — 2019-08-10
- 1.0.1 — 2019-08-09

## README

# libj-window-scrollbar
### Part of libj tools

This is used to __`remove`__ window's scrollbar temporarily and __`restore`__ it again

__JQuery is a dependency__

## Usage (npm)
```
npm install libj-window-scrollbar
```
```
import { windowScrollbar } from 'libj-window-scrollbar'
```
```
windowScrollbar.remove()
/* removes window's scrollbar */

windowScrollbar.restore()
/* restores window's scrollbar to its previous position */
```

## Test
- Run this in a separate command line to start node server
```
node server.js
```
- Run one of the following to re-create bundles
```
npm run dev
npm run dev:watch
```
- Navigate to http://localhost:3000

## Source
```
var key = "-libj-window-scroll-position";
window[key] = window[key] || -1;
class WindowScrollBar {
    remove() {
        window[key] = $(document).scrollTop();
        $("body")
            .css("overflow", "hidden")
            .css("height", "100%");
        $("html")
            .css("overflow", "hidden")
            .css("height", "100%");
    }
    restore() {
        $("body").css("overflow", "visible");
        $("html").css("overflow", "visible");
        $(document).scrollTop(window[key]);
    }
}
var windowScrollbar = new WindowScrollBar();
export { windowScrollbar };
```

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