[JavaScript] Schriftart ändern

Dieses Thema im Forum "Webentwicklung" wurde erstellt von banstylez, 15. Dezember 2010 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 15. Dezember 2010
    Schriftart ändern

    Ich habe noch folgendes snippet auffer Platte gehabt und jetzt etwas angepasst

    Code:
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript">
     <!--
    var strHallo = "Wikileaks mirror is right on the way...";
    var aktiv = null;
    var i = 0, text = 1;
     
    function Typing (){
     document.getElementById("outID").innerHTML += strHallo.substr(i, 1);
     
     if (i++ >= 40)
     window.clearInterval(aktiv);
    }
     
    window.onload = function(){
     aktiv = window.setInterval("Typing()", 450);
    }
     //-->
    </script>
    
     <div id="outID">
    </div>
    So nun kann ich aber nicht die Schriftgröße bzw die Schriftfarbe ändern. Ich komme leider nimmer weiter, sieht wer den Fehler und kann mir helfen ?

    Danke schonmal
     
  2. 15. Dezember 2010
    AW: Schriftart ändern

    HTML:
    <style type="text/css">
     div#outID { font-size: 80px; color: #136A9F; }
    </style>
     
  3. 15. Dezember 2010
    AW: Schriftart ändern

    Ich

    Hätte man auch mal sehen können Danke dir aufjedenfall

    ~ closed
     
  4. 15. Dezember 2010
    AW: Schriftart ändern

    mir war ein wenig langweilig:

    HTML:
    <!DOCTYPE html>
    <html>
     <head>
     <title>...</title>
     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
     <style type="text/css">
     #outID {
     text-align:center;
     margin:10% auto;
     font-size:50px;
     color:#000;
     font-family:arial;
     font-weight:bold;
     letter-spacing:-2px;
     word-spacing:-2px;
     text-shadow:1px 1px 2px #999;
     text-transform:uppercase
     }
     </style>
     </head>
     <body>
     <p id="outID"></p>
     <script type="text/javascript">
     // <![CDATA[
     function TextFX(id, str, dl) {
     var text, len, off = 0;
     var timer, delay = 10, element;
     var after = function() {};
     
     function play(fn) {
     if(typeof fn == "function")
     after = fn;
     
     timer = window.setTimeout(step, delay);
     
     return timer;
     }
     
     function step(s) {
     element.innerHTML += text[off++];
     
     if(off >= len || s === true) {
     after();
     return;
     }
     
     // defer
     window.setTimeout(play, 0.01);
     }
     
     function repeat(times) {
     var ostep = step;
     
     step = function() {
     ostep();
     
     if(off >= len) {
     if(--times == 0)
     return;
     
     window.setTimeout(function() {
     element.innerHTML = "";
     off = 0;
     
     window.setTimeout(ostep, 500);
     }, 500);
     
     return;
     }
     } 
    
     play();
     }
     
     function stop() {
     window.clearTimeout(timer);
     }
     
     // -------------------------------------
     // constructor
     
     element = document.getElementById(id);
     text = str;
     len = text.length;
     delay = parseInt(dl) || 10;
    
     element.innerHTML = "";
     
     this.stop = stop;
     this.play = play;
     this.repeat = repeat;
     };
     
     // -----------------------------------
     
     new TextFX("outID", "Wikileaks mirror is right on the way", 15).play(
     function() {
     var out = document.getElementById("outID")
     out.innerHTML += '<span id="dot">...</span>';
     out.style.display = "inline";
     out.style.width = out.offsetWidth + "px";
     out.style.display = "block";
     out.style.textAlign = "left";
     
     new TextFX("dot", "...", 100).repeat(10);
     }
     );
     // ]]>
     </script>
     </body>
    </html>
    vielleicht kannst du das ja brauchen
     
  5. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.