mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
472 B
JavaScript
23 lines
472 B
JavaScript
let isHidePreloader = false;
|
|
const hidePreloader= function (){
|
|
if (!isHidePreloader){
|
|
document.querySelector('#website-preloader').style.opacity = 0;
|
|
setTimeout(()=>{
|
|
document.querySelector('#website-preloader').remove();
|
|
},510);
|
|
isHidePreloader = true;
|
|
}
|
|
};
|
|
|
|
window.addEventListener('load',function () {
|
|
hidePreloader();
|
|
});
|
|
|
|
// if field and didn't load after 10s
|
|
setTimeout(()=>{
|
|
hidePreloader();
|
|
},10000);
|
|
|
|
|
|
|