var preloader = document.getElementById("loading"); var body = document.querySelector("body"); var html = document.querySelector("html"); document.addEventListener("DOMContentLoaded", function () { setTimeout(function loader() { preloader.style.display = "none"; body.classList.remove("no-scroll-y"); body.classList.add("no-scroll-x"); html.classList.add("no-scroll-x"); }, 1500); });