• User

    Effetti di testo?

    Salve - Vengo subito al dunque ........dovrei aggiungere un effetto stile macchina da scrivere ( text teletype ) al testo che viene recuperato da un database Mysql

    ho provato in vari modi ma non ho ottenuto alcun risultato
    ad esempio con il Tag TT :

    [php]
    echo "<a><TT> $testo </a></TT><br>";
    [/php]

    Conoscete una soluzione ?

    Di seguito posto alcuni esempi di codice stile telescrivente :

    [html]
    <html>
    <head>
    <title>Effetto Macchina da scrivere</title>
    </head>
    <script language=Javascript>
    <!-- begin
    var max=0;
    function textlist()
    {
    max=textlist.arguments.length;
    for (i=0; i<max; i++)
    this*=textlist.arguments*;
    }
    tl=new textlist
    (
    "testo testo testo testo",
    "testo testo testo",
    "testo testo testo"
    );
    var x=0; pos=0;
    var l=tl[0].length;
    function textticker()
    {
    document.tickform.tickfield.value=tl[x].substring(0,pos)+"|";
    if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++;
    if(x==max) x=0; l=tl[x].length; } else
    setTimeout("textticker()",50);
    }
    // end -->
    </script>
    </head>

    <body onload="textticker()">

    <form name="tickform"><input type=text name="tickfield" size=40></form>
    </body>
    </html>
    [/html]

    OPPURE :

    [html]
    <html>
    <head>
    </head>
    <body>
    <br><br><br><br>
    <script language="JavaScript1.2">
    <!--
    var it=0
    var head="display:''"
    function initialize(){
    mytext=typing.innerText
    var myheight=typing.offsetHeight
    typing.innerText=''
    document.all.typing.style.height=myheight
    typeit()
    }
    function typeit(){
    typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
    if (it<mytext.length-1){
    it++
    setTimeout("typeit()",100)
    }
    else
    return
    }
    if (document.all)
    document.body.onload=initialize
    -->
    </script>
    <span id="typing" style="visiblity:hidden;height:2" style=&{head};>Bla bla bla bla bla bla </span>
    </body>
    </html>
    [/html]

    Grazie in anticipo per un'eventuale risposta


  • User

    Problema risolto !!

    per chi fosse interessato ecco la soluzione :

    [html]
    <span id="typing" style="visiblity:hidden;height:2" style=&{head};><?php echo $testo; ?>
    [/html]

    :ciauz: