1.0.5 • Published 5 years ago

vue-detached-scrollbar v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Vue Detached Scrollbar

This is a simple scrollbar that you can detach from the element that you want to scroll in. It comes with a minimal HTML structure.

Installation

Demo: https://ozangulle.github.io/vue-detached-scrollbar/

Installation

Simply type

npm install --save vue-detached-scrollbar

You'll need Vue.js to run it.

The components, Gallery and ScrollBar communicate with each other via scrollBus. You'll need to import and register it as data.

import {scrollBus} from 'vue-detached-scrollbar'

const app = new Vue({
  data: {
    scrollBus,
  },
}

Inside the components where you want to use Gallery and Scrollbar, you simply register them as components

import {ScrollBar} from 'vue-detached-scrollbar';

export default {
    components: {
        ScrollBar,
    },
}

You can customize the scrollbar using the css classes .scrollbar, .scrollbar-slider, and .scrollbar-wrapper. .scrollbar refers to the bar itself whereas .scrollbar-slider is the slider in it.

import {Gallery} from 'vue-detached-scrollbar';

export default {
    components: {
        Gallery,
    },
}

You can put whatever content you want to use between the tags . For example:

<gallery>
    <div id="gallery" class="gallery">
        <div class="gallery-item" v-for="image in imageGallery">
            <img :src="image.src">
        </div>
    </div>
</gallery>

It's important to keep the id 'gallery'. The package uses the id to select it.

Due to the nature of the mouse event listener, you should put a onmouseup="document.onmousemove = null" on the main body of the document.

To-do

  • Write tests

Development

Want to contribute? I can only work on this project on my free time, so any help is welcome.

Please refer to Contributing.md.

License

MIT

1.0.5

5 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0-beta.5

7 years ago

0.1.0-beta.4

7 years ago

0.1.0-beta.3

7 years ago

0.1.0-beta.2

7 years ago

0.1.0-beta.1

7 years ago

0.1.0-alpha.10

7 years ago

0.1.0-alpha.9

7 years ago

0.1.0-alpha.8

7 years ago

0.1.0-alpha.7

7 years ago

0.1.0-alpha.6

7 years ago

0.1.0-alpha.5

7 years ago

0.1.0-alpha.4

7 years ago

0.1.0-alpha.3

7 years ago

0.1.0-alpha.2

7 years ago

0.1.0-alpha.1

7 years ago

0.1.0

7 years ago