Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Composizione testi dinamici

    /summon helpers!

    www.avignon.it

    qualcuno ha idea di come si faccia lo script che "anima" in quella maniera le scritte in basso a destra?

    grazie mille!

  2. #2
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    questo codice dovrebbe far quel che chiedi... sinceramente non l'ho provato... chi l'ha postato in un thread di un altro forum ha detto che l'ha trovato sul forum dei 247media e funziona bene
    codice:
    TextField.prototype.setText = function(str) {
    	this.text = "";
    	this.destinationText = str;
    	this.count = 0;
    	this.numLoops = 1;
    	if (this.timer) {
    		clearInterval(this.timer);
    	}
    		this.timer = setInterval(this, "writeString", 50);
    	updateAfterEvent();
    };
    TextField.prototype.getLetter = function() {
    	var a = "234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    	return (a.charAt(Math.floor(Math.random()*a.length-1)));
    };
    TextField.prototype.writeString = function() {
    	if (this.destinationText.length*this.numLoops>=this.count) {
    		var c = "";
    		var b = 0;
    		while (b<this.destinationText.length) {
    			if (this.destinationText.charAt(B) != " ") {
    				if (Math.floor(this.count/this.numLoops)>b) {
    					c = c+this.destinationText.charAt(B);
    				} else {
    					c = c+this.getLetter();
    				}
    			} else {
    				c = c+" ";
    			}
    			b++;
    		}
    		this.text = c;
    		this.count++;
    	} else {
    		this.text = this.destinationText;
    		clearInterval(this.timer);
    	}
    	updateAfterEvent();
    };
    // yourInstanceName.protoType("put your kickass text here!");
    sezione1.setText("Azienda");

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.