vue-rellax

A plugin of Vue that adds a directive for parallax effect by rellax.js.
7,459 42
Install
npm install vue-rellax
Latest Version:0.2.0
Vue:2
License:MIT
Last Updated:May 28, 2021
Links: GitHub  ·  npm
Maintainer: yutahaga

vue-rellax

A plugin of Vue that adds a directive for parallax effect by Rellax.js.

Getting Started

Install

npm i vue-rellax -S

or

yarn add vue-rellax
Browser Support

Since this plugin uses WeakMap, old browsers need to load pollyfill.

<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=WeakMap"></script>

Usage

import Vue from 'vue'
import VueRellax from 'vue-rellax'

Vue.use(VueRellax)

const vm = new Vue({
  el: '#app',
  template: `
    <div v-rellax="{
      // Rellax Options
      // See: https://github.com/dixonandmoe/rellax#features
      speed: -2,
    }">
      I’m slow and smooth
    </div>
  `
})
Destroy

To destroy, assign false to v-relax.

const vm = new Vue({
  el: '#app',
  template: `
    <div>
      <p v-rellax="rellax">
        I’m slow and smooth
      </p>
      <button type="button" @click="destroyRellax">Destroy Rellax</button>
    </div>
  `,
  data() {
    return {
      rellax: {
        speed: -2
      }
    }
  },
  methods: {
    destroyRellax() {
      this.rellax = false
    }
  }
})
For Nuxt.js

In your nuxt.config.js

{
  plugins: [
    { src: '~~/node_modules/vue-rellax/lib/nuxt-plugin', ssr: false }
  ]
}

Related Packages

vue-parallax-view

Create a composite control that displays different images that react to the mous...

1,090 10
auth-analytic-vue

Authentication plugin for analytic dev

568 0
vue-snack

Snackbar plugin to Vue.JS

13,575 37
vue-parallax

Scrolls a image slower than the window to create a neat optical effect

2,516 82
virtual-table-vue

A virtual list view implementation with multiple columns

1,119 0

Version History

Version Released License
0.2.0 MIT
0.1.0 MIT