Hi,
I am trying both to preload and/or to place a loading.gif placeholder behind images in a list (the menu) while it loads and it just doesn't work.
The webpage:
Code:
http://ioanacolor.com
The placeholder CSS code:
Code:
.menu-grid ul li img {
background: url(loading.gif) center no-repeat !important;
}
The placeholder page head code:
Code:
<script>
;(function(){
var img1 = new Image();
img1.src = 'loading.gif';
})();
</script>
The preloading code (at the bottom of the page currently, though I also tried it in the head and it didn't work):
Code:
<div class="hidden">
<script type="text/javascript">
<!--//--><![CDATA[//><!--
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(
"image1.jpg",
"image2.jpg"
)
//--><!]]>
</script>
</div>
Thanks!
Bookmarks