From c49c68193142605a7694153ec7627e2105ecf022 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com> Date: Mon, 29 Jun 2020 11:29:29 +0530 Subject: [PATCH] fix: never copy code, not even your own code --- lib/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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