# sss-leash

> Browser scrollbar helper (Disable/Enable by X, Y) and more...

Latest version **2.1.5** (published 2019-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install sss-leash
pnpm add sss-leash
yarn add sss-leash
bun add sss-leash
```

## 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 | 2.1.5 |
| Published | 2019-06-03 |
| First published | 2019-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrey Ponomarenko |
| Maintainers | natteke |
| Keywords | leash, smokinsexysoftware, sss, js, helper, scroll, lock, locker |

## Links

- npm: https://www.npmjs.com/package/sss-leash
- Repository: https://github.com/Natteke/SmokinSexySoftware
- Homepage: https://github.com/Natteke/SmokinSexySoftware#readme
- Issues: https://github.com/Natteke/SmokinSexySoftware/issues
- npm.io page: https://npm.io/package/sss-leash

## 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

- 2.1.5 (latest) — 2019-06-03
- 2.1.4 — 2019-05-17
- 2.1.3 — 2019-04-15
- 2.1.2 — 2019-04-09
- 2.1.1 — 2019-04-08
- 2.1.0 — 2019-04-08

## README

<h1 align="center">Leash</h1>

- [About](#about)
- [Installation](#installation)
- Usage
  - [`Init`](#init)
  - [`Lock`](#lock)
  - [`Release`](#release)
  - [`isScrollable`](#isscrollable)
  - [`isScrollBar`](#isscrollbar)
  - [`isScrollAvailable`](#isscrollavailable)
- [License](#license)

## About
Leash is a Browser scrollbar helper (Disable/Enable by X and Y).

## Installation

1) <a target="_blank" href="https://raw.githubusercontent.com/Natteke/SmokinSexySoftware/master/packages/Leash/dist/Leash.js">Download Leash</a>

2) Connect `Leash` before your scripts.

3) See how to [create](#init) the Leash. 

```html
<script src="/assets/js/lib/Leash.js"></script>
```
 
##### Package managers 😎

If you are using package managers such as [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/en/), import this lib as usual.

```sh
# Yarn
yarn add sss-leash

# NPM
npm i sss-leash --save
```
Do `import Leash from 'sss-leash';`

## Init
### Create new Leash

```Javascript
const body = document.body;
const ScrollLeash = new Leash(body);
```
## Methods

### Lock

Lock scroll X or Y

```Javascript
ScrollLeash.lockX();
ScrollLeash.lockY();
```
> If you are facing jumps in `position:fixed` elements, add `[data-scroll-fixed]` attribute to this element

### Release

Release scroll X or Y

```Javascript
ScrollLeash.releaseX();
ScrollLeash.releaseY();
```

### isScrollable

Checks isScrollbar and isScrollAvailable

```Javascript
const isScrollable = Leash.isScrollable(document.documentElement); // true
```

### isScrollBar

Checks scrollBar existence;

```Javascript
const isScrollBar = Leash.isScrollBar(document.documentElement); // true
```

### isScrollAvailable

Checks if container can be scrolled

```Javascript
const isScrollAvailable = Leash.isScrollAvailable(document.documentElement); // true
```
 
## License 
This project is available under the [MIT](https://opensource.org/licenses/mit-license.php) license.

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