Added two new data attributes, data-rellax-min and data-rellax-max, that aim to solve #114.
I did not implement global options for it (not sure it makes sense, I'll wait for feedback on it).
Also added an example page, with 3 examples.
This can be used by simply passing an integer, that'll serve as cap for the translate.
So, for example, let's say we have an element with a speed of -5 and center: true.
To stop the element from moving further after reaching the original position, use data-rellax-max="0".
Use both data-rellax-min and max to define a range where the element is "allowed" to move.
The results are probably better with the center option enabled, because the elements go over their original positions more often that way.
(Docs coming soon 😅)
Btw, although very similar to #129, it does not serve the same purpose.
Added two new data attributes,
data-rellax-min
anddata-rellax-max
, that aim to solve #114. I did not implement global options for it (not sure it makes sense, I'll wait for feedback on it).Also added an example page, with 3 examples.
This can be used by simply passing an integer, that'll serve as cap for the translate. So, for example, let's say we have an element with a speed of
-5
andcenter: true
. To stop the element from moving further after reaching the original position, usedata-rellax-max="0"
.Use both
data-rellax-min
andmax
to define a range where the element is "allowed" to move.The results are probably better with the
center
option enabled, because the elements go over their original positions more often that way.(Docs coming soon 😅)
Btw, although very similar to #129, it does not serve the same purpose.