1<script>
2
3/*
4Preload images script
5By JavaScript Kit (http://javascriptkit.com)
6Over 400+ free scripts here!
7*/
8
9var myimages=new Array()
10function preloadimages(){
11for (i=0;i<preloadimages.arguments.length;i++){
12myimages[i]=new Image()
13myimages[i].src=preloadimages.arguments[i]
14}
15}
16
17
18//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
19preloadimages("http://mydomain.com/firstimage.gif","http://mydomain.com/secondimage.gif","http://mydomain.com/thirdimage.gif")
20
21</script>
1let preloadedMaps = [];
2 let preloadedWorkRoutes = [];
3 console.log('asdasdasdas')
4 function preloadImages(preloadedMaps, preloadedWorkRoutes){
5 var maps = [`${workMapDesktop}`, `${workMapMobile}`, `${playMapDesktop}`, `${playMapMobile}`];
6 var workRoutes = workRoutesDesktop.concat(workRoutesMobile);
7 for(let i = 0; i < workRoutes.length; i++) {
8 preloadedWorkRoutes[i] = new Image();
9 preloadedWorkRoutes[i].src = workRoutes[i]
10 }
11 for(let i = 0; i < maps.length; i++) {
12 preloadedMaps[i] = new Image();
13 preloadedMaps[i].src = maps[i]
14 }
15 }
16 preloadImages(preloadedMaps, preloadedWorkRoutes);