Results 1 to 2 of 2

Thread: need help on animated title

  1. #1
    Join Date
    Mar 2009
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default need help on animated title

    i cant seem to get the code to work here.

    i need it to be an animated wave


    Code:
    <body>
    
    <script LANGUAGE="JavaScript">
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    var message = new Array(); 
    message[0] = "Test!" var reps = 2; 
    var speed = 80;  
    var p = message.length; 
    var T = ""; 
    var C = 0; 
    var mC = 0; 
    var s = 0; 
    var sT = null; 
    if (reps < 1) reps = 1; 
    
    function doIt() {
    T = message[mC]; 
    A(); 
    }
    
    function A() {
    s++; 
    if (s > 8) { s = 1; }
    if (s == 1) { document.title = '. .`..`..` '+T+' .`..`..`.';  }
    if (s == 2) { document.title = ' ..`..`..` '+T+' .`..`..`.';  }
    if (s == 3) { document.title = '` ..`..`.. '+T+' `..`..`..';  }
    if (s == 4) { document.title = '\u00 af`..`..`.. '+T+' `..`..`..';  }
    if (s == 5) { document.title = ' `..`..`.. '+T+' `..`..`..';  }
    if (s == 6) { document.title = ' `..`..`.. '+T+' `..`..`..';  }
    if (s == 7) { document.title = '. `..`..`. '+T+' ..`..`..`';  }
    if (s == 8) { document.title = ' .`..`..`. '+T+' ..`..`..`';  }if (C < (8 * reps)) {
    sT = setTimeout("A()",  speed); 
    C++; 
    }
    else {
    C = 0; 
    s = 0; 
    mC++; 
    if(mC > p - 1) mC = 0; 
    sT = null; 
    doIt(); 
       }
    }
    
    doIt(); 
    </script>
    <!--<title>Dodo's New World - pixel star</title>-->
    <link rel="SHORTCUT ICON" href="favicon.ico">
    <script language="javascript" >
    // break out of frames
    if (parent.location.href!=window.location.href) {
    /*malicious javascript is not allowed.*/'index.php';
    }
    </script>
    <style>
    body {
    overflow: hidden;
    }
    </style>
    thanks!

    ~Shadow~

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    This code works, there were a couple of errors in your code, but it also needed to be in the <head> section

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <SCRIPT LANGUAGE="JavaScript">
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    var message = new Array();
    message[0] = "My Test Title"
    var reps = 2;
    var speed = 100; 
    var p = message.length;
    var T = "";
    var C = 0;
    var mC = 0;
    var s = 0;
    var sT = null;
    if (reps < 1) reps = 1;
    function doIt() {
    T = message[mC];
    A();
    }
    function A() {
    s++;
    if (s > 8) { s = 1;}
    if (s == 1) { document.title = '..`..`..` '+T+' .`..`..`.'; }
    if (s == 2) { document.title = '..`..`..` '+T+' .`..`..`.'; }
    if (s == 3) { document.title = '`..`..`.. '+T+' `..`..`..'; }
    if (s == 4) { document.title = '`..`..`.. '+T+' `..`..`..'; }
    if (s == 5) { document.title = '`..`..`.. '+T+' `..`..`..'; }
    if (s == 6) { document.title = '`..`..`.. '+T+' `..`..`..'; }
    if (s == 7) { document.title = '.`..`..`. '+T+' ..`..`..`'; }
    if (s == 8) { document.title = '.`..`..`. '+T+' ..`..`..`'; }if (C < (8 * reps)) {
    sT = setTimeout("A()", speed);
    C++;
    }
    else {
    C = 0;
    s = 0;
    mC++;
    if(mC > p - 1) mC = 0;
    sT = null;
    doIt();
       }
    }
    doIt();
    </script>
    </head>
    
    <body>
    </body>
    </html>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •