I'm having some difficulties making a "pre-load" script/css ecc... to load a background image before anything else.
I need this trick, because the background image is a gradient starting from white and the background color is a grey one.
Anybody can help me ? I tryed few methods ( css background, javascript onload ecc... )
CODE:
in head
<script type="text/javascript">
function preloadMyImages()
{
var imageList = [
"IMAGE.jpg"
];
for(var i = 0; i < imageList.length; i++ )
{
var imageObject = new Image();
imageObject.src = imageList[i];
}
}</script>
body
<body onload="preloadMyImages();">
css
#(id of element) { background:url("IMAGE.jpg") repeat-x top #c5c5c5;}