cs_omallet16
Messages postés15Date d'inscriptionjeudi 1 janvier 2004StatutMembreDernière intervention 1 novembre 2007 26 janv. 2004 à 11:13
jai un soucis jai un code en java script et j'aimerai le faire tourner en aleatoire mais je n'arrive pas a modifier la syntase (me rappel plus ouinnnn !!!)
voici le code :
dans la partie <head> </head>
<STYLE>
/* MODIFIEZ ICI LES PROPRIETES DE L'INTRODUCTION ! */
.intro {BACKGROUND-COLOR:navy;LEFT:0px;POSITION:absolute;TOP:0px}
</STYLE>
dans la partie
<center>
<SCRIPT>
// Copyright mallet olivier
var espeed=75 // VITESSE DE DISPARITION DES MORCEAUX
var counter=1
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=25;i++){
temp[i]=eval("document.p"+i+".clip")
temp2[i]=eval("document.p"+i)
temp[i].width=window.innerWidth/5
temp[i].height=window.innerHeight/5
}
for (i=1;i<=5;i++)
temp2[i].left=(i-1)*temp[i].width
for (i=6;i<=10;i++){
temp2[i].left=(i-6)*temp[i].width
temp2[i].top=temp[i].height
}
for (i=11;i<=15;i++){
temp2[i].left=(i-11)*temp[i].width
temp2[i].top=2*temp[i].height
}
for (i=16;i<=20;i++){
temp2[i].left=(i-16)*temp[i].width
temp2[i].top=3*temp[i].height
}
for (i=21;i<=25;i++){
temp2[i].left=(i-21)*temp[i].width
temp2[i].top=4*temp[i].height
}}
function erasecontainerns(){
window.scrollTo(0,0)
var whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
if (temp2[whichcontainer].visibility!="hide")
temp2[whichcontainer].visibility="hide"
else{
while (temp2[whichcontainer].visibility=="hide"){
whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
}
temp2[whichcontainer].visibility="hide"
}
if (counter==25)
clearInterval(beginerase)
counter++
espeed-=10
}
if (document.all){
var containerwidth=parseInt(document.body.clientWidth/5)
var containerheight=parseInt(document.body.offsetHeight/5)
for (i=1;i<=25;i++){
temp[i]=eval("document.all.p"+i+".style")
temp[i].width=containerwidth
temp[i].height=containerheight
}
for (i=1;i<=5;i++)
temp[i].left=(i-1)*containerwidth
for (i=6;i<=10;i++){
temp[i].left=(i-6)*containerwidth
temp[i].top=containerheight
}
for (i=11;i<=15;i++){
temp[i].left=(i-11)*containerwidth
temp[i].top=2*containerheight
}
for (i=16;i<=20;i++){
temp[i].left=(i-16)*containerwidth
temp[i].top=3*containerheight
}
for (i=21;i<=25;i++){
temp[i].left=(i-21)*containerwidth
temp[i].top=4*containerheight
}}
function erasecontainerie(){
var whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
if (temp[whichcontainer].visibility!="hidden")
temp[whichcontainer].visibility="hidden"
else{
while (temp[whichcontainer].visibility=="hidden"){
whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
}
temp[whichcontainer].visibility="hidden"
}
if (counter==25){
clearInterval(beginerase)
clearInterval(keeptop)
}
counter++
espeed-=10
}
if (document.layers)
beginerase=setInterval("erasecontainerns()",espeed)
else if (document.all){
beginerase=setInterval("erasecontainerie()",espeed)
keeptop=setInterval("window.scrollTo(0.0)",100)
}
</SCRIPT>
il me semble que cela ce passe dans la partie <head>
sue cette ligne .intro {BACKGROUND-COLOR:navy;LEFT:0px;POSITION:absolute;TOP:0px}
merci de me tenir au courant sur mon mail omallet@hotmail.com
26 janv. 2004 à 11:13
voici le code :
dans la partie <head> </head>
<STYLE>
/* MODIFIEZ ICI LES PROPRIETES DE L'INTRODUCTION ! */
.intro {BACKGROUND-COLOR:navy;LEFT:0px;POSITION:absolute;TOP:0px}
</STYLE>
dans la partie
<center>
<SCRIPT>
// Copyright mallet olivier
var espeed=75 // VITESSE DE DISPARITION DES MORCEAUX
var counter=1
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=25;i++){
temp[i]=eval("document.p"+i+".clip")
temp2[i]=eval("document.p"+i)
temp[i].width=window.innerWidth/5
temp[i].height=window.innerHeight/5
}
for (i=1;i<=5;i++)
temp2[i].left=(i-1)*temp[i].width
for (i=6;i<=10;i++){
temp2[i].left=(i-6)*temp[i].width
temp2[i].top=temp[i].height
}
for (i=11;i<=15;i++){
temp2[i].left=(i-11)*temp[i].width
temp2[i].top=2*temp[i].height
}
for (i=16;i<=20;i++){
temp2[i].left=(i-16)*temp[i].width
temp2[i].top=3*temp[i].height
}
for (i=21;i<=25;i++){
temp2[i].left=(i-21)*temp[i].width
temp2[i].top=4*temp[i].height
}}
function erasecontainerns(){
window.scrollTo(0,0)
var whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
if (temp2[whichcontainer].visibility!="hide")
temp2[whichcontainer].visibility="hide"
else{
while (temp2[whichcontainer].visibility=="hide"){
whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
}
temp2[whichcontainer].visibility="hide"
}
if (counter==25)
clearInterval(beginerase)
counter++
espeed-=10
}
if (document.all){
var containerwidth=parseInt(document.body.clientWidth/5)
var containerheight=parseInt(document.body.offsetHeight/5)
for (i=1;i<=25;i++){
temp[i]=eval("document.all.p"+i+".style")
temp[i].width=containerwidth
temp[i].height=containerheight
}
for (i=1;i<=5;i++)
temp[i].left=(i-1)*containerwidth
for (i=6;i<=10;i++){
temp[i].left=(i-6)*containerwidth
temp[i].top=containerheight
}
for (i=11;i<=15;i++){
temp[i].left=(i-11)*containerwidth
temp[i].top=2*containerheight
}
for (i=16;i<=20;i++){
temp[i].left=(i-16)*containerwidth
temp[i].top=3*containerheight
}
for (i=21;i<=25;i++){
temp[i].left=(i-21)*containerwidth
temp[i].top=4*containerheight
}}
function erasecontainerie(){
var whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
if (temp[whichcontainer].visibility!="hidden")
temp[whichcontainer].visibility="hidden"
else{
while (temp[whichcontainer].visibility=="hidden"){
whichcontainer=Math.round(Math.random()*25)
if (whichcontainer==0)
whichcontainer=1
}
temp[whichcontainer].visibility="hidden"
}
if (counter==25){
clearInterval(beginerase)
clearInterval(keeptop)
}
counter++
espeed-=10
}
if (document.layers)
beginerase=setInterval("erasecontainerns()",espeed)
else if (document.all){
beginerase=setInterval("erasecontainerie()",espeed)
keeptop=setInterval("window.scrollTo(0.0)",100)
}
</SCRIPT>
il me semble que cela ce passe dans la partie <head>
sue cette ligne .intro {BACKGROUND-COLOR:navy;LEFT:0px;POSITION:absolute;TOP:0px}
merci de me tenir au courant sur mon mail omallet@hotmail.com