How to load an image from the server with the download site?

Made this tab:
59d3627b0f852607237777.jpeg
When you click on tab and change the picture, but the problem is that when clicked there is a request to the server, he sends a picture and it is shown, that passes only 1-1,5 sec. How do we make all these 6 images load immediately with the page?
Here is the code:
var tab = $('.tab'), 
 tabContent = $('.tab_content'),
 advantage = $('.advantage'),
 tabImg = $('.slide img'),
 modalImg = $('#modal_img'),
 tabImages = ['./img/tab/tab_img1.jpg', './img/tab/tab_img2.jpg', './img/tab/tab_img3.jpg', './img/tab/tab_img4.jpg', './img/tab/tab_img5.jpg', './img/tab/tab_img6.jpg', './img/tab/tab_img7.jpg'],
 tabImagesMin = ['./img/tab/tab_img1.min.jpg', './img/tab/tab_img2.min.jpg', './img/tab/tab_img3.min.jpg', './img/tab/tab_img4.min.jpg', './img/tab/tab_img5.min.jpg', './img/tab/tab_img6.min.jpg', './img/tab/tab_img7.min.jpg']

hideTabsContent(1);



 hideTabsContent function(t) {
 for (var i = t; i < tabContent.length; i++) {
tabContent[i].classList.remove('show');
tabContent[i].classList.add('hide');
advantage[i].classList.remove('active');
}
}

 tab.on('click', function(event) {
 var target = event.target;

 for (var i = 0; i < tab.length; i++) {
 if (target === tab[i]) {

showTabsContent(i);
break;
}
}
});

 showTabsContent function(s) {
 if (tabContent[s].classList.contains('hide')) {
hideTabsContent(0);
advantage[s].classList.add('active');
tabContent[s].classList.remove('hide');
tabContent[s].classList.add('show');
 tabImg.attr('src', tabImagesMin[s]);
 modalImg.attr('src', tabImages[s]);
}
 }
June 14th 19 at 20:38
1 answer
June 14th 19 at 20:40
Solution
Something. Then substitute where necessary
function preloader() {
 // counter
 var i = 0;

 // create object
 imageObj = new Image();

 // set image list
 images = new Array();
images[0]="image1.jpg"
images[1]="image2.jpg"
images[2]="image3.jpg"
images[3]="image4.jpg"

 // start preloading
 for(i=0; i<=3; i++) {
imageObj.src=images[i];
}
}


src - www.techrepublic.com/article/preloading-and-the-ja...
Thank you. - lily.Abshire82 commented on June 14th 19 at 20:43

Find more questions by tags JavaScriptjQuery