mirror of
https://github.com/LBRYFoundation/lbryorg.git
synced 2025-08-23 20:47:23 +00:00
fix: such errors are worse
This commit is contained in:
parent
c49c681931
commit
5508f0f7d5
1 changed files with 4 additions and 5 deletions
|
@ -3,9 +3,8 @@ const depthFactor = 5; // Depth of the image wrt to the 0 z-index. Infinity bein
|
|||
const parallaxOffset = 20;
|
||||
$(window).on('scroll', () => {
|
||||
const movedBy = window.scrollY;
|
||||
|
||||
if ($(window).height() - parallax.getBoundingClientRect().top >= parallaxOffset) {
|
||||
$('.parallax').each((i, parallax) => {
|
||||
$('.parallax').each((i, parallax) => {
|
||||
if ($(window).height() - parallax.getBoundingClientRect().top >= parallaxOffset) {
|
||||
$(parallax).find('.parallax-layer').each((i, layer) => {
|
||||
const depth = $(layer).attr('data-depth-factor') || depthFactor; // dynamically get depthFactor
|
||||
|
||||
|
@ -13,8 +12,8 @@ $(window).on('scroll', () => {
|
|||
transform: `translateY(+${movedBy / depth}px)` // Move differently than the rest of the window
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
// /Parallax
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue