How to make smooth change of images in the background, with best personal Finance on the fixed element?Or how to preload images?

Using the mousewheel plugin did to the background was varied while scrolling, but now the problem is that when best personal Finance image do not have time to upload, seen as frames missing because of the speed. How to make every 100 px image has varied, and not every 1px, or fix the theme to make it smoothly
$(document).ready(function() {
 var path = "img/back",







 header = $('.header'),

 i = 0,
 maxi = 41;



 $('html').mousewheel(function(event) {
 var deltaY = event.deltaY;
 if (deltaY < 0 && i < maxi) {
 i -= deltaY ;






 $(header).css('background-image','url(' + path + i + '.jpg' +')');
event.preventDefault();
$(header).html(i);

}
});
});
April 4th 20 at 00:55
1 answer
April 4th 20 at 00:57
$('#foo').on('mousewheel', function(e){
e.preventDefault();
 return false;
}

setTimeout(function() {
$('#foo').off('mousewheel');
}, 1000);

Find more questions by tags CSSJavaScriptHTML