Ciao a tutti io ho questo script che produrrebbe un'immagine linkabile che gira per tutto lo schermo... e fino a qui tutto ok funziona tutto perfettamente.. il mio problema nasce nelle pagine dove ho presente delle parti fatte in flash, l'immagine che gira mi finisce dietro il flash e quindi non la vedo... perchè?? potete aiutarmi?
Allego lo script se vi può essere utile.
Ringrazio in anticipo per un eventuale aiuto
<script>
// Immagini fluttuanti sia in formato .gif che in formato .jpg.
// Aggiungine quante vuoi, ma ATTENZIONE: troppe immagini possono rallentare lo script !
var your_image=new Array()
your_image[0]="auguri.gif"
// Puoi inserire un link per ogni messaggio. Nel caso NON volessi associare
// un link inserisci il simbolo '#'
var your_image_link=new Array()
your_image_link[0]="http://www.sitoweb.it"
// e qui, infine, la velocità della fluttuazione delle immagini. A valore più alto
// corrisponde ina velocità più elevata
var floatingspeed=2
var tempo=20
var numberofimages=your_image.length-1
var stepx=new Array()
var stepy=new Array()
for (i=0;i<=numberofimages;i++) {
stepx[i]=randommaker(floatingspeed)
stepy[i]=randommaker(floatingspeed)
}
var imgwidth=new Array()
var imgheight=new Array()
for (i=0;i<=numberofimages;i++) {
imgwidth[i]=10
imgheight[i]=10
}
var x,y
var marginbottom
var marginleft=0
var margintop=0
var marginright
var timer
var spancontent=new Array()
var imgpreload=new Array()
for (i=0;i<=your_image.length;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=your_image[i]
}
for (i=0;i<=numberofimages;i++) {
spancontent[i]="[img]"+your_image[i]+"[/img]"
}
function setValues() {
if (document.all) {
marginbottom=document.body.clientHeight-5
marginright=document.body.clientWidth-5
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.all.span"+i)
thisspan.innerHTML=spancontent[i]
var thisspan = eval("document.all.span"+(i)+".style")
thisspan.posLeft=randommaker(marginright)
thisspan.posTop=randommaker(marginbottom)
}
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.all.span"+i)
imgwidth[i]=thisspan.offsetWidth
imgheight[i]=thisspan.offsetHeight
}
checkmovement()
}
if (document.layers) {
marginbottom=window.innerHeight-5
marginright=window.innerWidth-5
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i+".document")
thisspan.write(spancontent[i])
thisspan.close()
var thisspan=eval("document.span"+i)
thisspan.left=randommaker(marginright)
thisspan.top=randommaker(marginbottom)
}
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i+".document")
imgwidth[i]=thisspan.width
imgheight[i]=thisspan.height
}
checkmovement()
}
}
function randommaker(range) {
rand=Math.floor(range*Math.random())
if (rand==0) {rand=Math.ceil(range/2)}
return rand
}
function checkmovement() {
if (document.all) {
checkposition()
movepictures()
timer=setTimeout("checkmovement()",tempo)
}
if (document.layers) {
checkposition()
movepictures()
timer=setTimeout("checkmovement()",tempo)
}
}
function movepictures() {
if (document.all) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.all.span"+(i)+".style")
thisspan.posLeft+=stepx[i]
thisspan.posTop+=stepy[i]
}
}
if (document.layers) {
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.span"+i)
thisspan.left+=stepx[i]
thisspan.top+=stepy[i]
}
}
}
function checkposition() {
if (document.all) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.all.span"+i+".style")
if (thisspan.posLeft>marginright-imgwidth[i]) {
thisspan.posLeft-=Math.abs(stepx[i]+1)
stepx[i]=randommaker(floatingspeed)*-1
}
if (thisspan.posLeft<marginleft) {
thisspan.posLeft+=Math.abs(stepx[i])
stepx[i]=randommaker(floatingspeed)
}
if (thisspan.posTop>marginbottom-imgheight[i]) {
thisspan.posTop-=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)*-1
}
if (thisspan.posTop<margintop) {
thisspan.posTop+=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)
}
}
}
if (document.layers) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i)
if (thisspan.left>marginright-imgwidth[i]) {
thisspan.left-=Math.abs(stepx[i]+1)
stepx[i]=randommaker(floatingspeed)*-1
}
if (thisspan.left<marginleft) {
thisspan.left+=Math.abs(stepx[i])
stepx[i]=randommaker(floatingspeed)
}
if (thisspan.top>marginbottom-imgheight[i]) {
thisspan.top-=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)*-1
}
if (thisspan.top<margintop) {
thisspan.top+=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)
}
}
}
}
</script>
<script>
for (i=0;i<=numberofimages;i++) {
document.write("<span id='span"+i+"' style='position:absolute'></span>")
document.close()
}
</script>