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

https://github.com/imarc/v-scroll-sync


https://github.com/imarc/v-scroll-sync

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

v-scroll-sync
=============

v-scroll-sync is a vue directive, `v-scroll-sync`, that lets you keep the
scroll positions of multiple elements in sync.

Getting Started
---------------

Install via NPM (or yarn or such):

```
$ npm install v-scroll-sync
```

Import it in your code (or `require` it):

```
import Vue from 'vue';
import VScrollSync from 'v-scroll-sync';
Vue.use(VScrollSync);
```

Usage
-----

The most basic usage is like this:

```

...

...

```

If you add this on two scroll elements, it'll keep the percentage scrolled in
each direction in sync across all elements with this directive.

You can optionally specify name the group, in case you need multiple groups:

```

...

...

...

...

```

The directive also supports two modifiers, `.x` and `.y`, which can be used to
only synchronize scrollLeft or scrollTop respectively:

```

...

...

```

Lastly, if you want to do something totally custom, you can set the directive's
value to your own function:

```

...

...

```