# jquery-scroll

> scroll to a dom or y position

Latest version **1.1.1** (published 2016-05-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install jquery-scroll
pnpm add jquery-scroll
yarn add jquery-scroll
bun add jquery-scroll
```

## 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.1 |
| Published | 2016-05-16 |
| First published | 2016-05-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | Vanilla |
| Maintainers | liyaodonglibin |

## Links

- npm: https://www.npmjs.com/package/jquery-scroll
- Repository: git@gitlab_ssh.geekpark.net:geekpark/scroll-to
- npm.io page: https://npm.io/package/jquery-scroll

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) ^2.1.4

## Recent versions

- 1.1.1 (latest) — 2016-05-16
- 1.1.0 — 2016-05-16

## README

scroll-to DOM or y position
------
### Install

`npm i jquery-scroll --save`

### Usage
`scrollTo({param: value})`

* **selector/posY** *jQuery object or a Y position value*
* callback *[null] function body or name*
* offset *[0] number margin bootom to target*
* duration *[800] animate duration*
* easing *[swing/linear] animation timing function, more need plugin [official doc](http://api.jquery.com/animate/)*
* element *[html,body] default slide the document*

> NOTE:
> 1. **blod** meaning required param, else optional
> 2. Indifferent params order
> 3. need webpack && bable-loader support

### Example
1. git clone this project
2. `npm i` to install dependence
3. `npm run example` then open `http://localhost:8080/example/`

```javascript
import $ from 'jquery';
import scrollTo from 'jquery-scroll';

$('#scroll').on('click', function () {
  scrollTo({
    selector: '#about',
    callback: () => { alert('scroll end') }
  });
});
```

### Changelog
* 1.1.0 change `params[element]` to a jquery object, not jquery selector. eg: `$('#container')`, not `#container`

### What is gnpm ?
`gnpm` was private npm registry for [GeekPark](http://www.geekpark.net), [read more](https://github.com/cnpm/cnpmjs.org)

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