laipower/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js

1 line
471 B
JavaScript
Raw Normal View History

2024-02-08 12:31:51 +00:00
function generate_sections_parallax_element(e,t){var o=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(o)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_sections_parallax_element(".generate-sections-container.enable-parallax").forEach(function(t,o,n){var a=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=a?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-speed")+"px":t.style.backgroundPositionY="0"})});