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

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

NotificationsYou must be signed in to change notification settings

vue-comps/vue-parallax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Install

npm install --save-dev vue-parallax// vue@1.0npm install --save-dev vue-parallax@1

or includebuild/bundle.js.

Usage

# in your componentcomponents:"parallax":require("vue-parallax")# or, when using bundle.jscomponents:"parallax":window.vueComps.parallax
<parallaxsrc="path/to/img"><divslot="loading">loading...</div><div>content</div></parallax>

content will be shown after loading

For examples seedev/.

ERROR: Module build failed: SyntaxError: 'with' in strict mode

Currentlybuble is injectingstrict mode in all processed js files. The down to ES5 compiled component containswith, which is forbidden instrict mode.Buble is used, for example, in rollup, which is used in laravel.

If you are running in this problem, make sure to exclude this component from processing with buble.

Webpack

If your assets are organized by webpack, this should work:

<parallaxsrc=require('../assets/your-image.jpg')></parallax>

Props

Nametypedefaultdescription
srcString-(required) path to image
heightNumber500height of the parallax element
speedNumber0.20.0 means the image will appear fixed in place, and 1.0 the image will flow at the same speed as the page content.

Events

Name | description---:| --- | ---| ---image-loaded | will be called when the image is loadedloaded | will be called when the first calculation - after a image is loaded - is finished

Changelog

  • 2.1.3
    bugfix in portrait mode

  • 2.1.2
    now working on devices in portrait mode

  • 2.1.1
    bugfix

  • 2.1.0
    changed way the picture moves, now in line with other parallax implementations

  • 2.0.0
    now compatible with vue 2.0.0

  • 1.0.0
    some cleaning
    added unit tests
    now working with firefox

Development

Clone repository.

npm installnpm run dev

Browse tohttp://localhost:8080/.

License

Copyright (c) 2016 Paul PflugradtLicensed under the MIT license.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp