Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tiny vue component that adds a directive for parallax effect on elements.

NotificationsYou must be signed in to change notification settings

jsnanigans/vue-parallax-js

Repository files navigation

Tiny vue component that adds a directive for parallax effect on elements.

  • no dependencies
  • lightweight
  • 1.3k gzip

Setup

npm install --save vue-parallax-js# or use yarnyarn add vue-parallax-js

in your main JavaScript file

// import Vue and vue-parallax-jsimportVuefrom'vue'importVueParallaxJsfrom'vue-parallax-js'// add vue-parallax-js to vueVue.use(VueParallaxJs)

Usage

when everything is setup you can use the directive like this:

<h1v-parallax="0.2">vue-parallax-js</h1>

Options

Vue.use(VueParallaxJs, options)
constoptions={minWidth:Number,/* minumum window width for parallax to take effect */className:String,/* this class gets added to all elements                      that are being animated, by default none */container:String,/* element that actually scrolls, by default it's window */}

Modifiers

when using thev-parallax directive you can also pass some modifiers to configure the instance of vue-parallax-js

<h1v-parallax.modifier="0.2">vue-parallax-js</h1>
ModifierDescription
horizontalhorizontal based parallax
centerXwill addtransform: translateX(-50%) along with the parallax positioning
absYuses the window height instead of the element height for the calculations

About

Tiny vue component that adds a directive for parallax effect on elements.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp