I have checked a few other forums and can't get it to work. On the website there are three images with a hover effect. On the first page load the hover effect takes a second to load the background image.
Here is what I have inbetween my
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>
then I have this in my body tag:
<body <?php body_class(); ?> onLoad="MM_preloadImages('http://agconcretepro.com/wp-content/uploads/2016/07/designreplace2.png','http://agconcretepro.com/wp-content/uploads/2016/07/ConcreteREPLACE.png','http://agconcretepro.com/wp-content/uploads/2016/07/no_title_paver.png')">
Doesn't work for the three images I need preloaded. I also copy and pasted this from google searching, and tried putting it in various places in my header.php to no avail.
<script type="text/javascript">
if (document.images) {
img1 = new Image();
img2 = new Image();
img3 = new Image();
img1.src = "http://agconcretepro.com/wp-content/uploads/2016/07/designreplace2.png";
img2.src = "http://agconcretepro.com/wp-content/uploads/2016/07/ConcreteREPLACE.png";
img3.src = "http://agconcretepro.com/wp-content/uploads/2016/07/no_title_paver.png";
}
</script>
Any help here would be awesome! Thank you!
</div>