Creare uno script che fa comparire immagini casuali sul sito

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
Buongiorno a tutti, sperando in un vostro aiuto vado a documentare la mia cortese richiesta :

ho trovato uno script che appunto fa comparire l'immagine di un fantasma che si muove in modo casuale in un sito e vi posto il codice :

HTML:
<HTML>
<HEAD>

<script language="JavaScript">
if ((document.getElementById) &&
window.addEventListener || window.attachEvent){
(function(){
//Configurazione Effetto Fantasmi
var numberOfGhosts = 10; /* Numero dei fantasmi */
var ghostSpeed = 0.9; /* Velocità */
var inTheFace = 5;
var setTimeOutSpeed = 50; /* Tempo di permanenza */
//NON EDITARE SOTTO A QUESTA RIGA ESCLUSO URL IMMAGINE
var h,y,cy,cx,sy,sx,ref,field,oy1,oy2,ox1,ox2,iy1,iy2,ix1,ix2;
var d = document;
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var pi1 = 180/3.14;
var pi2 = 3.14/180;
var y = [];
var x = [];
var strs = [];
var gro = [];
var dim = [];
var dfc = [];
var vel = [];
var dir = [];
var acc = [];
var dtor = [];
var xy2 = [];
var idx = document.getElementsByTagName('div').length;
var zip = [];
var pix = "px";
for (i = 0; i < numberOfGhosts; i++){
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="fantasma.gif" class="ghost" width="70"/></div>');
}
if (domWw) ref = window;
else{
if (d.documentElement &&
typeof d.documentElement.clientWidth == "number" &&
d.documentElement.clientWidth != 0)
ref = d.documentElement;
else{
if (d.body &&
typeof d.body.clientWidth == "number")
ref = d.body;
}
}
function win(){
var mozBar = ((domWw) &&
ref.innerWidth != d.documentElement.offsetWidth)?20:0;
h = (domWw)?ref.innerHeight:ref.clientHeight;
w = (domWw)?ref.innerWidth - mozBar:ref.clientWidth;
cy = Math.floor(h/2);
cx = Math.floor(w/2);
oy1 = (75 * h / 100);
oy2 = (oy1 / 2);
ox1 = (75 * w / 100);
ox2 = (ox1 / 2);
iy1 = (18 * h / 100);
iy2 = (iy1 / 2);
ix1 = (18 * w / 100);
ix2 = (ix1 / 2);
field = (h > w)?h:w;
}
function rst(s){
var cyx;
sy = (domSy)?ref.pageYOffset:ref.scrollTop;
sx = (domSy)?ref.pageXOffset:ref.scrollLeft;
acc[s] = 0;
dim[s] = 1;
xy2[s] = 0;
cyx = Math.round(Math.random() * 2);
if (cyx == 0){
y[s] = (cy - iy2) + Math.floor(Math.random() * iy1);
x[s] = (cx - ix2) + Math.floor(Math.random() * ix1);
}
else{
y[s] = (cy - oy2) + Math.floor(Math.random() * oy1);
x[s] = (cx - ox2) + Math.floor(Math.random() * ox1);
}
dy = y[s] - cy;
dx = x[s] - cx;
dir[s] = Math.atan2(dy,dx) * pi1;
dfc[s] = Math.sqrt(dy*dy + dx*dx) ;
zip[s] = 10 * (dfc[s] + inTheFace) / 100;
vel[s] = ghostSpeed * dfc[s] / 100;
dtor[s] = (field - dfc[s]);
if (dtor[s] < 1) dtor[s] = 1;
gro[s] = 0.003 * dtor[s] / 100;
}
function animate(){
for (i = 0; i < numberOfGhosts; i++){
y[i] += vel[i] * Math.sin(dir[i] * pi2);
x[i] += vel[i] * Math.cos(dir[i] * pi2);
acc[i] = (vel[i] / (dfc[i] + (vel[i] * zip[i])) * vel[i]);
vel[i] += (acc[i]);
dim[i] += gro[i] + acc[i] / zip[i];
xy2[i] = dim[i] / 2;
if (y[i] < 0 + xy2[i] ||
x[i] < 0 + xy2[i] ||
y[i] > h - xy2[i] ||
x[i] > w - xy2[i]){
rst(i);
}
strs[i].top = (y[i] - xy2[i]) + sy + pix;
strs[i].left = (x[i] - xy2[i]) + sx + pix;
strs[i].width = (strs[i].height = (Math.round(dim[i])) + pix);
}
setTimeout(animate,setTimeOutSpeed);
}
function init(){
win();
for (i = 0; i < numberOfGhosts; i++){
strs[i] = document.getElementById("ghosts"+(idx+i)).style;
rst(i);
}
animate();
}
if (window.addEventListener){
window.addEventListener("resize",win,false);
window.addEventListener("load",init,false);
}
else if (window.attachEvent){
window.attachEvent("onresize",win);
window.attachEvent("onload",init);
}
})();
}//End.
</script>
<style>
.ghost {
filter:alpha(opacity=30);
-moz-opacity: 0.3;
opacity: 0.3;
-khtml-opacity: 0.3;
}
html {
overflow-x:hidden;
}
</style>

</HEAD>
<BODY>
</BODY>
</HTML>

E funziona perfettamente, adesso se io volessi non far comparire solo il fantasma ma in modo casuale altre immagini devo creare un altro script che richiama le immagini e poi inserirlo nel codice iniziale, bene lo script dovrebbe essere questo :

HTML:
<script language="Javascript">
<!--
function image() {};
image = new image();
number = 0;

image[number++] = "<img src='nomeimmagine1.jpg'>"
image[number++] = "<img src='nomeimmagine2.jpg'>"
image[number++] = "<img src='nomeimmagine3.jpg'>"

increment = Math.floor(Math.random() * number);
//-->
</script>

e poi inserire la seguente stringa :
HTML:
<script language="JavaScript"> document.write(image[increment]); </script>
nel punto opportuno del codice di sopra.
E precisamente in questa parte :

HTML:
for (i = 0; i < numberOfGhosts; i++){
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="fantasma.gif" class="ghost" width="70"/></div>');
}
Ma ho fatto vari tentativi, chiaramente ho messo la funzione nel codice ....
Potete aiutarmi per cortesia ?
Vi ringrazio anticipatamente come sempre. Saluti a tutti
 
Ho provato anche in quest'altro modo :

HTML:
for (i = 0; i < numberOfGhosts; i++){
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="id="imag"" class="ghost" width="70"/></div>');
}
if (domWw) ref = window;
else{
if (d.documentElement &&
typeof d.documentElement.clientWidth == "number" &&
d.documentElement.clientWidth != 0)
ref = d.documentElement;
else{
if (d.body &&
typeof d.body.clientWidth == "number")
ref = d.body;
}
}

function immagini() { 
img = new Array()
ran = Math.floor(3 * Math.random());
img[0] = 'angelo.gif';
img[1] = 'spade.gif';
img[2] = 'fantasma.gif';
document.getElementById("imag").innerHTML = img[ran] }
ma neanche va.... mi escono i riquadri delle immagini che si muovono, ma non vengono visualizzate :((
 
Facendo riferimento ad uno script del genere :

HTML:
<html>
<head>


<script language="JavaScript">
<!--
img = new Array()
ran = Math.floor(3 * Math.random());
img[0] = 'fantasma.gif';
img[1] = 'angelo.gif';
img[2] = 'spade.gif';
document.write("<img src=\""+img[ran]+"\">");
// -->
</script>



</head>

<body>

</body>
</html>

che funziona perfettamente, ho pensato che la logica dovendo essere la stessa ho agito cosi :

HTML:
var idx = document.getElementsByTagName('div').length;
var zip = [];
var pix = "px";

img = new Array()
ran = Math.floor(3 * Math.random());
img[0] = 'fantasma.gif';
img[1] = 'angelo.gif';
img[2] = 'spade.gif';



for (i = 0; i < numberOfGhosts; i++){

document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src=[\""+img[ran]+"\"]; class="ghost" width="70"/></div>');
}

ma nessun risultato, eppure in effetti dopo l'aver creato l'array c'è il write... perchè non va... help :(
 
In parte risolto....

Anche se non ho ricevuto nessuna risposta :), per correttezza dico che in parte ho risolto... cosi :

HTML:
var idx = document.getElementsByTagName('div').length;
var zip = [];
var pix = "px";

img = new Array()
ran = Math.floor(3 * Math.random());
img[0] = 'fantasma.gif';
img[1] = 'angelo.gif';
img[2] = 'spade.gif';
urlofimage=img[ran]

for (i = 0; i < numberOfGhosts; i++){
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="'+urlofimage+'" class="ghost" width="70"/></div>');
}

adesso il mio problema è di far uscire le immagini casualmente ma non ad ogni refresh ma dopo diciamo tre secondi ho provato a fare cosi ma niente :
HTML:
img = new Array()

img[0] = 'fantasma.gif';
img[1] = 'angelo.gif';
img[2] = 'spade.gif';

function random() { ran = Math.floor(3 * Math.random()); 
}

function cambia() {
random()
urlofimage=img[ran]
document.write("<img src=""+urlofimage+"">");
}

cambia();
setInterval("cambia()",3000);



for (i = 0; i < numberOfGhosts; i++){
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="'+urlofimage+'" class="ghost" width="70"/></div>');
}

se volete io vi leggo sempre :) buona serata....
 
Ciao,
ci sono apici in piu qui
Codice:
function cambia() {
random()
urlofimage=img[ran]
document.write("<img src=""+urlofimage+"">");
}
modifica
Codice:
function cambia() {
random()
urlofimage=img[ran]
document.write("<img src='"+urlofimage+"'>");
}
 
Buongiorno e ti ringrazio per la risposta.... ma quel write l'avevo messo a volo per vedere se mi leggeva le frasi... chiaramente nel codice terminato non serve, in effetti il codice pulito è cosi :
HTML:
img = new Array()

img[0] = 'fantasma.gif';
img[1] = 'angelo.gif';
img[2] = 'spade.gif'; 

function random() { ran = Math.floor(3 * Math.random())
 setInterval('random()',3000); }


function cambia() {     
random()
urlofimage=img[ran]
} 
cambia()



for (i = 0; i < numberOfGhosts; i++){ 
document.write('<div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"><img src="'+urlofimage+'"  class="ghost" width="70"/></div>'); 
}

ma non funziona cioè le fotine non cambiano in automatico ogni tot secondi... questo è il mio problema :(
 
Provalo cosi
HTML:
<script>
    var img = new Array()
    var ran;
    img[0] = 'fantasma.gif';
    img[1] = 'angelo.gif';
    img[2] = 'spade.gif';
    function random() { 
        ran = Math.floor(3 * Math.random());                 
    }
    function cambia() {                
        random()
        var urlofimage = img[ran]
        // giusto per vedere se cambia
        alert(urlofimage);
        
        setTimeout("cambia()",3000);
    }            
    cambia();
</script>
 
Da solo come te l'ho postato funziona

bisogna vedere come lo hai inserito nel resto
 
Provalo cosi:
l'alert appare ma cmq le immagini non cambiano Vedi se riesci a scoprire il perche Ora devo uscire
Ricordati che se vuoi utilizzare una variabile in piu funzioni devi dichiararla al di fuori di esse
Codice:
<HTML>
    <HEAD>

        <script language="JavaScript">
            var img = new Array()
            var ran;           
            
           img[0] = 'fantasma.gif';
           img[1] = 'angelo.gif';
           img[2] = 'spade.gif';
            
            var urlofimage = img[0];
            
            function random() { 
                ran = Math.floor(3 * Math.random());                 
            }
            function cambia() {                
                random()
                urlofimage = img[ran];
                alert(urlofimage);
                setTimeout("cambia()",3000);
            }            
            cambia();
    
            if ((document.getElementById) &&
                window.addEventListener || window.attachEvent){
                (function(){
                    //Configurazione Effetto Fantasmi
                    var numberOfGhosts = 10; /* Numero dei fantasmi */
                    var ghostSpeed = 0.9; /* Velocità */
                    var inTheFace = 5;
                    var setTimeOutSpeed = 50; /* Tempo di permanenza */
                    //NON EDITARE SOTTO A QUESTA RIGA ESCLUSO URL IMMAGINE
                    var h,y,cy,cx,sy,sx,ref,field,oy1,oy2,ox1,ox2,iy1,iy2,ix1,ix2;
                    var d = document;
                    var domWw = (typeof window.innerWidth == "number");
                    var domSy = (typeof window.pageYOffset == "number");
                    var pi1 = 180/3.14;
                    var pi2 = 3.14/180;
                    var y = [];
                    var x = [];
                    var strs = [];
                    var gro = [];
                    var dim = [];
                    var dfc = [];
                    var vel = [];
                    var dir = [];
                    var acc = [];
                    var dtor = [];
                    var xy2 = [];
                    var idx = document.getElementsByTagName('div').length;
                    var zip = [];
                    var pix = "px";
                    for (i = 0; i < numberOfGhosts; i++){
                        document.write('<div id="ghosts'+(idx+i)+'"'
                            +' style="position:absolute;top:0px;left:0px;'
                            +'width:40px;height:40px;background-color:transparent;'
                            +'font-size:0px;"><img src="'+urlofimage+'" class="ghost" width="70"/></div>');
                    }
                    if (domWw) ref = window;
                    else{
                        if (d.documentElement &&
                            typeof d.documentElement.clientWidth == "number" &&
                            d.documentElement.clientWidth != 0)
                            ref = d.documentElement;
                        else{
                            if (d.body &&
                                typeof d.body.clientWidth == "number")
                                ref = d.body;
                        }
                    }
                    function win(){
                        var mozBar = ((domWw) &&
                            ref.innerWidth != d.documentElement.offsetWidth)?20:0;
                        h = (domWw)?ref.innerHeight:ref.clientHeight;
                        w = (domWw)?ref.innerWidth - mozBar:ref.clientWidth;
                        cy = Math.floor(h/2);
                        cx = Math.floor(w/2);
                        oy1 = (75 * h / 100);
                        oy2 = (oy1 / 2);
                        ox1 = (75 * w / 100);
                        ox2 = (ox1 / 2);
                        iy1 = (18 * h / 100);
                        iy2 = (iy1 / 2);
                        ix1 = (18 * w / 100);
                        ix2 = (ix1 / 2);
                        field = (h > w)?h:w;
                    }
                    function rst(s){
                        var cyx;
                        sy = (domSy)?ref.pageYOffset:ref.scrollTop;
                        sx = (domSy)?ref.pageXOffset:ref.scrollLeft;
                        acc[s] = 0;
                        dim[s] = 1;
                        xy2[s] = 0;
                        cyx = Math.round(Math.random() * 2);
                        if (cyx == 0){
                            y[s] = (cy - iy2) + Math.floor(Math.random() * iy1);
                            x[s] = (cx - ix2) + Math.floor(Math.random() * ix1);
                        }
                        else{
                            y[s] = (cy - oy2) + Math.floor(Math.random() * oy1);
                            x[s] = (cx - ox2) + Math.floor(Math.random() * ox1);
                        }
                        dy = y[s] - cy;
                        dx = x[s] - cx;
                        dir[s] = Math.atan2(dy,dx) * pi1;
                        dfc[s] = Math.sqrt(dy*dy + dx*dx) ;
                        zip[s] = 10 * (dfc[s] + inTheFace) / 100;
                        vel[s] = ghostSpeed * dfc[s] / 100;
                        dtor[s] = (field - dfc[s]);
                        if (dtor[s] < 1) dtor[s] = 1;
                        gro[s] = 0.003 * dtor[s] / 100;
                    }
                    function animate(){
                        for (i = 0; i < numberOfGhosts; i++){
                            y[i] += vel[i] * Math.sin(dir[i] * pi2);
                            x[i] += vel[i] * Math.cos(dir[i] * pi2);
                            acc[i] = (vel[i] / (dfc[i] + (vel[i] * zip[i])) * vel[i]);
                            vel[i] += (acc[i]);
                            dim[i] += gro[i] + acc[i] / zip[i];
                            xy2[i] = dim[i] / 2;
                            if (y[i] < 0 + xy2[i] ||
                                x[i] < 0 + xy2[i] ||
                                y[i] > h - xy2[i] ||
                                x[i] > w - xy2[i]){
                                rst(i);
                            }
                            strs[i].top = (y[i] - xy2[i]) + sy + pix;
                            strs[i].left = (x[i] - xy2[i]) + sx + pix;
                            strs[i].width = (strs[i].height = (Math.round(dim[i])) + pix);
                        }
                        setTimeout(animate,setTimeOutSpeed);
                    }
                    function init(){
                        win();
                        for (i = 0; i < numberOfGhosts; i++){
                            strs[i] = document.getElementById("ghosts"+(idx+i)).style;
                            rst(i);
                        }
                        animate();
                    }
                    if (window.addEventListener){
                        window.addEventListener("resize",win,false);
                        window.addEventListener("load",init,false);
                    }
                    else if (window.attachEvent){
                        window.attachEvent("onresize",win);
                        window.attachEvent("onload",init);
                    }
                })();
            }//End.
        </script>
        <style>
            .ghost {
                filter:alpha(opacity=30);
                -moz-opacity: 0.3;
                opacity: 0.3;
                -khtml-opacity: 0.3;
            }
            html {
                overflow-x:hidden;
            }
        </style>

    </HEAD>
    <BODY>
    </BODY>
</HTML>
 
Non che lo script mi faccia impazzire ..... cmq
provalo cosi,
nota cosa ho aggiunto nella funzione animate()
ho semplificato la tua funzione cambia() usando solo la random()
Codice:
<HTML>
    <HEAD>
        <script language="JavaScript">
            var img = new Array()
            var ran;            
            
            img[0] = 'file_gif.png';
            img[1] = 'file_jpg.png';
            img[2] = 'file_php.png';
            
            var urlofimage = img[0];
            function random() { 
                ran = Math.floor(3 * Math.random());  
                urlofimage = img[ran];
            }                    
            setInterval("random()",3000);
            
            if ((document.getElementById) &&
                window.addEventListener || window.attachEvent){
                (function(){
                    //Configurazione Effetto Fantasmi
                    var numberOfGhosts = 10; /* Numero dei fantasmi */
                    var ghostSpeed = 0.9; /* Velocità */
                    var inTheFace = 5;
                    var setTimeOutSpeed = 50; /* Tempo di permanenza */
                    //NON EDITARE SOTTO A QUESTA RIGA ESCLUSO URL IMMAGINE
                    var h,y,cy,cx,sy,sx,ref,field,oy1,oy2,ox1,ox2,iy1,iy2,ix1,ix2;
                    var d = document;
                    var domWw = (typeof window.innerWidth == "number");
                    var domSy = (typeof window.pageYOffset == "number");
                    var pi1 = 180/3.14;
                    var pi2 = 3.14/180;
                    var y = [];
                    var x = [];
                    var strs = [];
                    var gro = [];
                    var dim = [];
                    var dfc = [];
                    var vel = [];
                    var dir = [];
                    var acc = [];
                    var dtor = [];
                    var xy2 = [];
                    var idx = document.getElementsByTagName('div').length;
                    var zip = [];
                    var pix = "px";
                        
                    for (i = 0; i < numberOfGhosts; i++){
                        
                        document.write('<div id="ghosts'+(idx+i)+'"'
                            +' style="position:absolute;top:0px;left:0px;'
                            +'width:40px;height:40px;background-color:transparent;'
                            +'font-size:0px;"><img src="'+urlofimage+'" class="ghost" width="70"/></div>');
                    } 
                       
                    if (domWw) ref = window;
                    else{
                        if (d.documentElement &&
                            typeof d.documentElement.clientWidth == "number" &&
                            d.documentElement.clientWidth != 0)
                            ref = d.documentElement;
                        else{
                            if (d.body &&
                                typeof d.body.clientWidth == "number")
                                ref = d.body;
                        }
                    }
                    function win(){
                         
                        var mozBar = ((domWw) &&
                            ref.innerWidth != d.documentElement.offsetWidth)?20:0;
                        h = (domWw)?ref.innerHeight:ref.clientHeight;
                        w = (domWw)?ref.innerWidth - mozBar:ref.clientWidth;
                        cy = Math.floor(h/2);
                        cx = Math.floor(w/2);
                        oy1 = (75 * h / 100);
                        oy2 = (oy1 / 2);
                        ox1 = (75 * w / 100);
                        ox2 = (ox1 / 2);
                        iy1 = (18 * h / 100);
                        iy2 = (iy1 / 2);
                        ix1 = (18 * w / 100);
                        ix2 = (ix1 / 2);
                        field = (h > w)?h:w;
                    }
                    function rst(s){
                        var cyx;
                        sy = (domSy)?ref.pageYOffset:ref.scrollTop;
                        sx = (domSy)?ref.pageXOffset:ref.scrollLeft;
                        acc[s] = 0;
                        dim[s] = 1;
                        xy2[s] = 0;
                        cyx = Math.round(Math.random() * 2);
                        if (cyx == 0){
                            y[s] = (cy - iy2) + Math.floor(Math.random() * iy1);
                            x[s] = (cx - ix2) + Math.floor(Math.random() * ix1);
                        }
                        else{
                            y[s] = (cy - oy2) + Math.floor(Math.random() * oy1);
                            x[s] = (cx - ox2) + Math.floor(Math.random() * ox1);
                        }
                        dy = y[s] - cy;
                        dx = x[s] - cx;
                        dir[s] = Math.atan2(dy,dx) * pi1;
                        dfc[s] = Math.sqrt(dy*dy + dx*dx) ;
                        zip[s] = 10 * (dfc[s] + inTheFace) / 100;
                        vel[s] = ghostSpeed * dfc[s] / 100;
                        dtor[s] = (field - dfc[s]);
                        if (dtor[s] < 1) dtor[s] = 1;
                        gro[s] = 0.003 * dtor[s] / 100;
                    }
                    function animate(){
                        for (i = 0; i < numberOfGhosts; i++){
                            y[i] += vel[i] * Math.sin(dir[i] * pi2);
                            x[i] += vel[i] * Math.cos(dir[i] * pi2);
                            acc[i] = (vel[i] / (dfc[i] + (vel[i] * zip[i])) * vel[i]);
                            vel[i] += (acc[i]);
                            dim[i] += gro[i] + acc[i] / zip[i];
                            xy2[i] = dim[i] / 2;
                            if (y[i] < 0 + xy2[i] ||
                                x[i] < 0 + xy2[i] ||
                                y[i] > h - xy2[i] ||
                                x[i] > w - xy2[i]){
                                rst(i);
                            }
                            strs[i].top = (y[i] - xy2[i]) + sy + pix;
                            strs[i].left = (x[i] - xy2[i]) + sx + pix;
                            strs[i].width = (strs[i].height = (Math.round(dim[i])) + pix);
                            document.getElementById("ghosts"+(idx+i)).innerHTML = "<img src='"+urlofimage+"' class='ghost' width='70'/>";
                        }
                        
                        setTimeout(animate,setTimeOutSpeed);
                    }
                    function init(){
                        win();
                        for (i = 0; i < numberOfGhosts; i++){
                            
                            
                            strs[i] = document.getElementById("ghosts"+(idx+i)).style;
                            rst(i);
                        }
                        animate();
                    }
                    if (window.addEventListener){
                       
                        window.addEventListener("resize",win,false);
                        window.addEventListener("load",init,false);
                    }
                    else if (window.attachEvent){
                        
                        window.attachEvent("onresize",win);
                        window.attachEvent("onload",init);
                    }
                })();
            }//End.
            
        </script>
        <style>
            .ghost {
                filter:alpha(opacity=30);
                -moz-opacity: 0.3;
                opacity: 0.3;
                -khtml-opacity: 0.3;
            }
            html {
                overflow-x:hidden;
            }
        </style>

    </HEAD>
    <BODY>
    </BODY>
</HTML>
 
Grazie per prima cosa e chiaramente funziona, mi spieghi la logica, altrimenti davvero mi sento un ebete.... prima di tutto le cose cerco di capirle.... e l'ammetto, non ci sarei arrivato a mettere quel valore dom nella function animate... :) Buona domenica intanto. :)
 
@Borgo
in effetti lo script deve essere un po datato, ho provato a cercarlo in rete velocemente e mi sono fermato a una riproposta di ottobre 2011, lo stesso autore afferma di averlo trovato in rete ma non ha saputo fornire la fonte. Penso che potrebbe essere del 2003 2004

@cavaliere123
Se mi stai chiedendo la logica dell'intero script, non ne ho la piu pallida idea. Mi sono limitato a trovare la funzione che veniva richiamata piu di una volta ed ad inserire li il cambio immagine.
Non sono uno da teoria. Mi piace smanettare.
 
Ok.... io invece mi sto imparando tutto da capo.... altrimenti davvero impazzisco :))
ho infatti una nuova domanda ma stavolta facile, la posto per correttezza in una nuova discussione :)
 

Discussioni simili