|
|
|
|
J'ai trouvé un script genial de barre de progression compatible IE et NS mais ne marche pas sous firefox/mozilla. Comment faire?
Merci pour la réponse
Voisi le script :
entre les balise head :
<!-- DEBUT DU SCRIPT -->
<!-- SCRIPT TROUVE SUR WEBJS -->
<style>
<!--
#bar, #fondbar{
position:absolute;
left:0;
top:0;
background-color:006699;
}
#fondbar{
background-color:black;
}
-->
</style>
<SCRIPT language="JavaScript1.2">
var duration=5
function postaction(){
window.location="adresse de redirection automatique"
}
/// FIN DE LA CONFIGURATION - NE PAS EDITER LE RESTE ! //
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.fondbarNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</SCRIPT>
<!-- FIN DU SCRIPT -->
entre les balises body :
<!-- DEBUT DU SCRIPT -->
<!-- SCRIPT TROUVE SUR WEBJS -->
<SCRIPT language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
document.write('<div id="fondbar" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
}
</SCRIPT>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20> </p>
<layer name="fondbarNS" bgcolor="black" width=200 height=20 z-index="10" left="0" top="0">
</layer>
<layer name="barNS" bgcolor="#006699" width=200 height=20 z-index="11" left="0" top="0">
</layer>
</ilayer>
<!-- FIN DU SCRIPT -->
Tiens, voila bcp plus simple qui marche sur Mozilla 5 et Internet explorer 6 testé par moi.... voila le code complet de la page avec bcp plus de rigueur dans le code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> #Cadre{ position:absolute; left:10px; top:50px; width:500px; height:20px; border:1px navy solid; background-color:#F3F3F3; } #Progress{ position:absolute; left:10px; top:50px; width:0px; height:20px; background-color:#FF6699; border-left:1px navy solid; border-bottom:1px navy solid; border-top:1px navy solid; } </style> <script type="text/javascript"> var incremProgress = 10; var progressWith=0; var urlRedirect = "http://www.e-rus.net/"; function startProgress() { progressWith = progressWith + incremProgress; if( progressWith < 500) document.getElementById("Progress").style.width = progressWith + "px"; else { document.getElementById("Progress").style.width = "500px"; window.location = urlRedirect; } } setInterval("startProgress()",50); </script> <title>Progress Barre</title> </head> <body> <script type="text/javascript"> document.write("Vous allez être redirigé dans un instant vers cette url : " + urlRedirect) </script> <div id="Cadre"></div> <div id="Progress" ></div> </body> </html> A toi de tester sur Netscape... moi j'ai pas
|
??? moi ca fonctionne tres bien sur IE... le 6. La source est ici :
|