2021-12-20 13:42:43 +00:00
|
|
|
!function(){"use strict";var s;"querySelector"in document&&"addEventListener"in window&&(s=document.querySelector(".generate-back-to-top"),s&&(window.addEventListener("scroll",function(){var e=window.pageYOffset,t=s.getAttribute("data-start-scroll");t<e&&(s.style.opacity="1",s.style.visibility="visible"),e<t&&(s.style.opacity="0",s.style.visibility="hidden")}),s.addEventListener("click",function(e){var t,n,o,i,r;e.preventDefault(),generatepressBackToTop.smooth?(document.body,t=s.getAttribute("data-scroll-speed")||400,e=window.pageYOffset,n=document.body.offsetTop,o=(n-e)/(t/16),i=function(){window.pageYOffset<=(n||0)&&(clearInterval(r),document.activeElement.blur())},r=setInterval(function(){window.scrollBy(0,o),i()},16)):window.scrollTo(0,0)},!1)))}();
|