Bonjour,
J'ai récupéré ce scrip qui permet d'afficher des images qui se déplacent (type bulles sur fond bleu). Cependant, ces images ne s'affichent pas sur toute la page.
Est ce que qq1 pourrait m'aider?
Voilà le code:
"<SCRIPT language=JavaScript>
<!--
var number =12
var speed = 50
var maximg =2
var act = new Array(),positionX = new Array(),positionY = new Array()
var moveX = new Array(),moveY = new Array()
var j = maximg
img = new Array()
img[0] = "030610_b1.gif"
img[1] = "030610_b2.gif"
img[2] = "030610_b3.gif"
for (var i = 0; i < number ;++ i) {
act[i] = 0
positionX[i] = Math.random()*document.body.clientWidth-50
positionY[i] = Math.random()*document.body.clientHeight
moveX[i] = 0.1 + Math.random()/100
moveY[i] = 0.1 + Math.random()*3
if (i == 0)
{
document.write("<div id=\"fly"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible\"><img src=\"" + img[j] + "\" border=\"0\"></div>" )}
else {
document.write("<div id=\"fly"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible\"><img src=\"" + img[j] + "\" border=\"0\"></div>" )}
if (j == 0) { j = maximg }
else { j -= 1 }
}
function gofly() {
for (var i = 0; i < number ;++ i) { // iterate for every fly
positionY[i] -= moveY[i]
act[i] += moveX[i]
document.all["fly"+i].style.pixelTop = positionY[i]+ Math.cos(act[i])*positionY[i]/15
document.all["fly"+i].style.pixelLeft = positionX[i] + Math.sin(act[i])*positionX[i]/50
if (positionY[i] < 0) {
moveX[i] = 0.1+ Math.random()/100
moveY[i] = 0.1 + Math.random()*3
positionX[i] = Math.random()*document.body.clientWidth-50
positionY[i] = document.body.clientHeight
}
}
setTimeout("gofly()", speed)
}
gofly()
-->
</SCRIPT>"