File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ For examples see [`dev/`](dev/).
3333| ---:| --- | ---| --- |
3434| src | String | - | (required) path to image |
3535| height | Number | 500 | height of the parallax element |
36- | speed | Number | 0.8 | 0 doesn't scroll the image, 1 scrolls through the whole image |
36+ | speed | Number | 1 | 0 doesn't scroll the image, 1 scrolls through the whole image |
3737
3838
3939# Development
Original file line number Diff line number Diff line change 11<template lang="jade">
2- parallax(src="parallax1.jpg")
2+ parallax(src="http://materializecss.com/images/ parallax1.jpg")
33.parallax-between
44 a(href="https://github.com/vue-comps/vue-parallax/blob/master/dev/basic.vue") source
5- parallax(src="parallax2.jpg")
5+ parallax(src="http://materializecss.com/images/ parallax2.jpg")
66.parallax-between
77.parallax-between
88</template >
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module.exports =
2626 default : 500
2727 " speed" :
2828 type : Number
29- default : 0.8
29+ default : 1
3030
3131 data : ->
3232 viewportHeight : 0
@@ -59,7 +59,7 @@ module.exports =
5959 @parallaxDistance = Math .floor (@$el .clientWidth * @ratio ) - height
6060 @scrollDistance = @viewportHeight + height* 2
6161 @style .height = height + " px"
62- @ processScroll ()
62+ @ $nextTick @ processScroll
6363 processScroll : ->
6464 rect = @$el .getBoundingClientRect ()
6565 if rect .bottom > 0 and rect .top < @viewportHeight # in viewport
You can’t perform that action at this time.
0 commit comments