I have about 30-40 images that I'm currently attempting to reload. However, I still get this "flicker" when I hover over a image. The images disappear for a couple of milliseconds and then comes back.
var images = new Array()
function preload() {
for (i = 0; i < preload.arguments.length; i++) {
images[i] = new Image();
images[i].src = preload.arguments[i];
}
}
preload(
"/../../regular.png",
"/../../hover.png"
);
This is the function I am currently using, is it something wrong with the code above or could it be another issue?
Your function has an error: you need to access the arguments object directly, not as a property of the function. Try it like this:
According to MDN, the syntax you are currently using (preload.arguments) is deprecated and won't work in all browsers.
(If you check your browser's JS console you should see an error reported, and because of the error for loop wouldn't run so the images wouldn't preload.)