If your website is created with Joomla and you prefer to use mouseover images for your navigation it may take some time to load the image when you put your mouse over it. This wont make you happy certainly. In this regard, if you wish to prevent this lag time for loading image in your navigation, an Image Preloader Script can be the solution. Let’s see how you can do it.
Add the following Javascript snippet just above your closing head tag:
<html>
<head>
<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>
</head>
Then add the full url’s of the images you want to preload in the body tag.
In this way, you can easily reduce the time of loading your mouseover image.
hello albert
is not working in joomla 1.5/1.7 at all
this line is unclear:
“Then add the full url’s of the images you want to preload in the body tag”
the editor of joomla put this way the code of image mouseover (J1.5):
adding the full urls of images or not is not working.
others ways to put the url shows the url like a tag and does not work.
Would you have a demo site or example to see it work or to compare the code?
regards and thanks for your post
is the only one in the entire web about this problem 🙂
sorry! the code is not show because the img tag.
my fault
here the code of the joomla’s mouseover:
img src=”images/stories/name.jpg” onmouseout=”this.src=’http://site/images/stories/name.jpg’ onmouseover=”this.src=http://site/images/stories/name2.jpg’