Visualizzazione risultati 1 fino 8 di 8

Discussione: neve ke scende

  1. #1
    Guest

    Predefinito neve ke scende

    salve xkè ho messo lo script ke simula la neve ke scende xrò a metà pagina sparisce nn arriva fino alla fine della pagina?

  2. #2
    Guest

    Predefinito

    devi modificare lo script

  3. #3
    Guest

    Predefinito

    ecco lo scritp cosa devo modificare?
    Codice HTML:
    <script LANGUAGE="JavaScript1.2">
    <!-- 
    var no = 15; 
    var speed = 2;
    var snowflake = "http://stronginvision.interfree.it/fiocco.gif";
    
    var ns4up = (document.layers) ? 1 : 0; 
    var ie4up = (document.all) ? 1 : 0;
    var dx, xp, yp; 
    var am, stx, sty; 
    var i, doc_width = 800, doc_height = 600;
    if (ns4up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    } else if (ie4up) {
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    dx = new Array();
    xp = new Array();
    yp = new Array();
    am = new Array();
    stx = new Array();
    sty = new Array();
    for (i = 0; i < no; ++ i) { 
    dx[i] = 0; 
    xp[i] = Math.random()*(doc_width-50); 
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20; 
    stx[i] = 0.02 + Math.random()/10; 
    sty[i] = 0.7 + Math.random(); 
    if (ns4up) { 
    if (i == 0) {
    document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
    document.write("top=\"15\" visibility=\"show\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></layer>");
    } else {
    document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
    document.write("top=\"15\" visibility=\"show\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></layer>");
    }
    } else if (ie4up) {
    if (i == 0) {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></div>");
    } else {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></div>");
    }
    }
    }
    function snowNS() { 
    for (i = 0; i < no; ++ i) { 
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
    xp[i] = Math.random()*(doc_width-am[i]-30);
    yp[i] = 0;
    stx[i] = 0.02 + Math.random()/10;
    sty[i] = 0.7 + Math.random();
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    dx[i] += stx[i];
    document.layers["dot"+i].top = yp[i];
    document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowNS()", speed);
    }
    function snowIE() { 
    for (i = 0; i < no; ++ i) { 
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
    xp[i] = Math.random()*(doc_width-am[i]-30);
    yp[i] = 0;
    stx[i] = 0.02 + Math.random()/10;
    sty[i] = 0.7 + Math.random();
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    dx[i] += stx[i];
    document.all["dot"+i].style.pixelTop = yp[i];
    document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowIE()", speed);
    }
    if (ns4up) {
    snowNS();
    } else if (ie4up) {
    snowIE();
    }
    // -->
    </script>
    Ultima modifica di debug : 21-12-2006 alle ore 19.33.44

  4. #4
    Guest

    Predefinito

    prova a vedere se qui trovi qualcosa che ti piace

    ps
    quando posti del codice usa i tag [html ][/ html] e [php ][/ php]

  5. #5
    Guest

    Predefinito

    nn lo sapevo scusa

  6. #6
    Guest

    Predefinito

    la stringa da cambiare e questa ed e' tra le prime righe di codice

    var i, doc_width = 800, doc_height = 600;

    che e' impostata per una risoluzione 800 x 600

    mettila a 1024 x 2000

    ciaooo
    Ultima modifica di Bluroy : 21-12-2006 alle ore 22.27.52

  7. #7
    Guest

    Predefinito

    niente sempre la stessa cosa dove devo inserirlo di preciso?

  8. #8
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Dove c'è:
    Codice:
    var i, doc_width = 800, doc_height = 600;
    Devi scrivere:
    Codice:
    var i, doc_width = 1024, doc_height = 2000;
    Però io metterei così:
    Codice:
    var i, doc_width = screen.width, doc_height = screen.height;
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •