FREE CODE Friday, 10.20.2017, 0:47 AM
Main | Registration | Login Welcome Guest | RSS
[ New messages · Members · Forum rules · Search · RSS ]
۞Forum Statistics۞
NEW TOPPIV
HOT TOPPIC
TOP MEMBERS
NEW MEMBERS
  • check code here Have(0) reviews faxuhi
  • Keywords meta Tags Have(0) reviews faxuhi
  • text box Have(0) reviews faxuhi
  • Page description Have(0) reviews faxuhi
  • marquee Have(0) reviews faxuhi
  • print your page Have(0) reviews faxuhi
  • choose your country Have(0) reviews faxuhi
  • check all - unchek all Have(0) reviews faxuhi
  • shadow text Have(0) reviews faxuhi
  • Beautiful text two Have(0) reviews faxuhi
  • Nice menu with java script <p1> Have(2) reviews faxuhi
  • Mouse Clock Have(1) reviews faxuhi
  • HTML table placeholder Have(0) reviews faxuhi
  • Html graphic bullets Have(0) reviews faxuhi
  • Different times of the world by the users choice from a list Have(0) reviews faxuhi
  • Mouseover Alert HTML Script Have(0) reviews faxuhi
  • Redirect to another page and link automatically to other pg Have(0) reviews faxuhi
  • Combo box link box to browse your website easily Have(0) reviews faxuhi
  • Message to user by clicking a button Have(0) reviews faxuhi
  • Background changing color effect Have(0) reviews faxuhi
  • faxuhi[189]Bài
  • mcsnagger0022[0]Bài
  • thinknoodles[0]Bài
  • karaganis888[0]Bài
  • faxuhi [189]Bài
  • mcsnagger0022 [0]Bài
  • thinknoodles [0]Bài
  • karaganis888 [0]Bài
  • Page 1 of 11
    Forum » Web Javascript » Flying Text » Flying Text
    Flying Text
    faxuhiDate: Monday, 07.25.2011, 3:13 PM | Message # 1
    Colonel
    Group: Administrators
    Messages: 189
    Reputation: 0
    Status: Offline
    Code
    <STYLE type=text/css>#supertext {
      LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: hidden
    }
    </STYLE>
    <script language="JavaScript1.2">
    var thecontent='<h2><font color="#0000FF">Welcome to my weblog!</font></h2>'
    var hidetimer='';
    var BallSpeed = 5;
    var contentWidth;
    var contentHeight;
    var maxBallSpeed = 50;
    var xMax;
    var yMax;
    var xPos = 0;
    var yPos = 0;
    var xDir = 'right';
    var yDir = 'down';
    var superballRunning = true;
    var tempBallSpeed;
    var currentBallSrc;
    var newXDir;
    var newYDir;

    function initializeBall() {
        if (document.all) {
           xMax = document.body.clientWidth
           yMax = document.body.clientHeight
           document.all("supertext").style.visibility = "visible";
           contentWidth=supertext.offsetWidth
           contentHeight=supertext.offsetHeight
           }
        else if (document.layers) {
           xMax = window.innerWidth;
           yMax = window.innerHeight;
           contentWidth=document.supertext.document.width
           contentHeight=document.supertext.document.height
           document.layers["supertext"].visibility = "show";
           }
        setTimeout('moveBall()',400);
        if (hidetimer!='')
        setTimeout("hidetext()",hidetimer)
        }

    function moveBall() {
        if (superballRunning == true) {
           calculatePosition();
           if (document.all) {
              document.all("supertext").style.left = xPos + document.body.scrollLeft;
              document.all("supertext").style.top = yPos + document.body.scrollTop;
              }
           else if (document.layers) {
              document.layers["supertext"].left = xPos + pageXOffset;
              document.layers["supertext"].top = yPos + pageYOffset;
              }
           animatetext=setTimeout('moveBall()',20);
           }
        }

    function calculatePosition() {
        if (xDir == "right") {
           if (xPos > (xMax - contentWidth - BallSpeed)) {  
              xDir = "left";
              }
           }
        else if (xDir == "left") {
           if (xPos < (0 + BallSpeed)) {
              xDir = "right";
              }
           }
        if (yDir == "down") {
           if (yPos > (yMax - contentHeight - BallSpeed)) {
              yDir = "up";
              }
           }
        else if (yDir == "up") {
           if (yPos < (0 + BallSpeed)) {
              yDir = "down";
              }
           }
        if (xDir == "right") {
           xPos = xPos + BallSpeed;
           }
        else if (xDir == "left") {
           xPos = xPos - BallSpeed;
           }
        else {
           xPos = xPos;
           }
        if (yDir == "down") {
           yPos = yPos + BallSpeed;
           }
        else if (yDir == "up") {
           yPos = yPos - BallSpeed;
           }
        else {
           yPos = yPos;
           }
        }

    function hidetext(){
    if (document.all)
    supertext.style.visibility="hidden"
    else if (document.layers)
    document.supertext.visibility="hide"
    clearTimeout(animatetext)
    }

    if (document.all||document.layers){
    document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
    window.onload = initializeBall;
    window.onresize = new Function("window.location.reload()");
    }

    </script></body>

    </html>
     
    Forum » Web Javascript » Flying Text » Flying Text
    Page 1 of 11
    Search:

    Copyright MyCorp © 2017 Website builderuCoz