Entaille javascript [loader a la gmail]

j-mi

WRInaute passionné
entre <head> </head>

Code:
   <script type="text/javascript">
// <![CDATA[
function hideLoadingPage(){
if (document.getElementById){  // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
} else {
if (document.layers){  // Netscape 4
document.hidepage.visibility = 'hidden';
} else {  // IE 4
document.all.hidepage.style.visibility = 'hidden';
}
}
}
// ]]>
</script>
<style type="text/css" media="screen">
#hidepage {
   position:absolute;
   left:0px;
   top:-2px;
   width:100%;
   height:100%;
   display:block;
}
#hideloadingpage {
   position:absolute;
   background:#770000;
   right:0px;
   top:-2px;
   width:200px;
   height:15px;
   display:block;
   margin-top:6px;
}
img {
         padding: 5px;
         border: 1px solid #CCC;
      }
</style>

votre body

Code:
<body onLoad="hideLoadingPage();">

justre apres Body

Code:
<body onLoad="hideLoadingPage();">
<div id="hidepage">
<table width="100%" border="0" cellspacing="0">
<tr>
<td align="right">
<script type="text/javascript">
// <![CDATA[
var message="Chargement de la page en cours...";
var neonbasecolor="#FFFFFF";var neontextcolor="#000000";var neontextcolor2="#000000";
var flashspeed=40; // vitesse de défilement en millisecondes
var flashingletters=2; // nombre de lettres simultanément changées
var flashingletters2=2; // number of letters flashing in neontextcolor2 (0 to disable)
var flashpause=0; // durée de la pause entre chaque flash
var n=0;
if (document.all||document.getElementById){
document.write('<div id="hideloadingpage"><font color="'+neonbasecolor+'">');
for (m=0;m<message.length;m++){document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')}
document.write('</font></div');}
else {document.write(message) ;}
function crossref(number){
var crossobj=document.all? document.all["neonlight"+number] : document.getElementById("neonlight"+number);
return crossobj;               }
function neon(){
if (n==0){for (m=0;m<message.length;m++){crossref(m).style.color=neonbasecolor}}crossref(n).style.color=neontextcolor;
if (n>flashingletters-1){crossref(n-flashingletters).style.color=neontextcolor2};
if (n>(flashingletters+flashingletters2)-1){crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor};
if (n<message.length-1){n++;}else{n=0;clearInterval(flashing);setTimeout("beginneon()",flashpause);return;}
}
function beginneon(){
if (document.all||document.getElementById){flashing=setInterval("neon()",flashspeed)}
}
beginneon();
// ]]>
</script>
</td>
</tr>
</table>
</div>

Enjoy :D
 

Discussions similaires

Haut