B
bedges
okay, the scenario:
i have a header image which changes randomly across all pages in the
site. that works fine. i also have an image preloader within the random
header picker which theoretically loads the header image before the
rest of the graphical content on the page. however, what appears to be
happening, judging by the status bar messages, is that the banner
always loads last.
here's the random header code -
function random_header()
{
no=Math.random()*14;
no=Math.round(no);
no = no + 1;
bname = "banners/banner_" + no + ".jpg";
preload=new Image();
preload.src=bname;
document.getElementById('rndimg').src=bname;
}
banners are all named sequentially, 'rndimg' is the blank header image
having its source changed.
any help is appreciated. thanks meantime
i have a header image which changes randomly across all pages in the
site. that works fine. i also have an image preloader within the random
header picker which theoretically loads the header image before the
rest of the graphical content on the page. however, what appears to be
happening, judging by the status bar messages, is that the banner
always loads last.
here's the random header code -
function random_header()
{
no=Math.random()*14;
no=Math.round(no);
no = no + 1;
bname = "banners/banner_" + no + ".jpg";
preload=new Image();
preload.src=bname;
document.getElementById('rndimg').src=bname;
}
banners are all named sequentially, 'rndimg' is the blank header image
having its source changed.
any help is appreciated. thanks meantime