diff --git a/lib/js/index.js b/lib/js/index.js index 2ede2fb..0785fe2 100644 --- a/lib/js/index.js +++ b/lib/js/index.js @@ -4,7 +4,7 @@ const parallaxOffset = 20; $(window).on('scroll', () => { const movedBy = window.scrollY; - if ($(window).height() - elem.getBoundingClientRect().top >= parallaxOffset) { + if ($(window).height() - parallax.getBoundingClientRect().top >= parallaxOffset) { $('.parallax').each((i, parallax) => { $(parallax).find('.parallax-layer').each((i, layer) => { const depth = $(layer).attr('data-depth-factor') || depthFactor; // dynamically get depthFactor