]
function preImg(imgArray) {
var perStep = 100/imgArray.length;
var percent = 0;
//console.log(imgArray.length +';'+perStep+';'+perStep*imgArray.length);
for (i = 0; i < imgArray.length; i++) {
(function (img, src) {
img.onload = function () {
percent = percent + perStep;
//console.log(percent + '% loaded');
jQuery('.preloader_line').css('width', percent+'%');
if (percent >= 99) {
removePreloader();
}
};
img.src = src;
} (new Image(), imgArray[i]));
}
}