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

1 line
435 B
JavaScript
Raw Normal View History

2023-10-22 22:21:44 +00:00
function generate_parallax_element(e,t){var a=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(a)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_parallax_element(".parallax-enabled").forEach(function(t,a,o){var r=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=r?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-parallax-speed")+"px":t.style.backgroundPositionY="0"})});