1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <script type="text/javascript"> // JavaScript Document
var time = 3; // temps en seconde apres lequel la bar de chargement disparait une fois finie
var maxtime = 120; // temps maximum apres lequel la bar de chargement disparait
/* PAs touche */
var done = 1;
time = time * 1000;
maxtime = maxtime * 1000;
loaded = new Array();
function Pre_load()
{
for( index = 0; index < document.images.length; index++ )
{
loaded[ index ] = false;
}
}
window.setTimeout( "document.getElementById('Loading_Img').style.visibility='hidden';", maxtime );
function Preload_Img()
{
imgs = document.images;
for( index = 0; index < imgs.length; index++ )
{
if( done >= imgs.length )
{
break;
}
else if( imgs[ index ].complete && loaded[ index ] == false )
{
done++;
loaded[ index ] = true;
}
}
if( done >= imgs.length )
{
window.setTimeout( "document.getElementById('Loading_Img').style.visibility='hidden';", time );
}
else
{
window.setTimeout( "Preload_Img()", '58' );
}
if( done == imgs.length )
{
window.setTimeout( "window.location.href='intro.html';", time);
}
PRC = Math.round( ( ( done / imgs.length ) * 100 ) );
barwidth = PRC * 2.13 ;
preview =
'<img src="images/loadingbar.gif" width=' + barwidth + ' height = 13/>'
+'<br />'+'<br />'
+ ' '+ PRC + ' ' + '%'
document.getElementById('Loading_Img').innerHTML = preview;
}
Pre_load();
Preload_Img();
</script> |
Partager