preload javascript
<link rel="preload" href="main.js" as="script">
<script src="main.js" defer></script>
preload javascript
<link rel="preload" href="main.js" as="script">
<script src="main.js" defer></script>
preloader js code
//preloader//
const win = $(window);
win.on("load", () => $("#preloader").fadeOut('800'));
preload images javascript
let preloadedMaps = [];
let preloadedWorkRoutes = [];
console.log('asdasdasdas')
function preloadImages(preloadedMaps, preloadedWorkRoutes){
var maps = [`${workMapDesktop}`, `${workMapMobile}`, `${playMapDesktop}`, `${playMapMobile}`];
var workRoutes = workRoutesDesktop.concat(workRoutesMobile);
for(let i = 0; i < workRoutes.length; i++) {
preloadedWorkRoutes[i] = new Image();
preloadedWorkRoutes[i].src = workRoutes[i]
}
for(let i = 0; i < maps.length; i++) {
preloadedMaps[i] = new Image();
preloadedMaps[i].src = maps[i]
}
}
preloadImages(preloadedMaps, preloadedWorkRoutes);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us