An open API service indexing awesome lists of open source software.

https://github.com/tizee/tz-scrollto

A simple scroll-to plugin for my blog.
https://github.com/tizee/tz-scrollto

Last synced: 5 months ago
JSON representation

A simple scroll-to plugin for my blog.

Awesome Lists containing this project

README

          


tz-scrollto


a scroll-to plugin for my blog

## Motivation

Enhance in-page navigation experience by scrolling to the element that the `` linked to so that it feels like taking an elevator.

## Usage

I used this plugin in my blog's React component.

```jsx
import TzScrollTo from 'tz-scrollto'

...
{
e.preventDefault();
tzScrollTo(e.target,{
// millisecond
duration: 600,
// timing function
// maybe it's overkill to use a spring animation library like `react-spring`
easing: 'linear'
})
}}
/>

...

```

### spring animation

For those who want to use spring animations, I'd recommend `react-spring`, `react-motion`.