Programalama > JAVA SCRIPT


Ort. 0
Puan ver:
<SCRIPT language="JavaScript" type="text/javascript">

var message = "İSTEDİĞİNİZİ YAZIN"; 
var col = new Array('#ff0000','#00aa00','#0000ff');
var xyz = 26; //max grow size.
var spd = 30; //setTimeout speed.
var msg = message.split(" ");
var timer = null;
var clrPos = 0;
var msgPos = 0;
var jog = 1;
var currentStep = 10;
var step = 8;
var h,w,y,x,r,xy;
var d = document;
var pix = "px";
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var running = true;
var box,txt;
var ovrflw =  (d.documentElement.style && 
typeof d.documentElement.style.MozOpacity == "string")
?"-moz-scrollbars-none":"hidden";
var idx = d.getElementsByTagName('div').length;

d.write("<div id='_box"+idx+"' style='position:absolute;top:0px;left:0px;"
+"height:10px;width:10px;text-align:center;overflow:"+ovrflw+"'>"
+"<div id='_txt"+idx+"' style='position:absolute;top:0px;left:0px;width:1px;"
+"height:1px;font-family:arial,sans-serif;font-size:1px'>.<\/div><\/div>"); 

if (domWw) r = window;
else
{ 
   if (d.documentElement && 
      typeof d.documentElement.clientWidth == "number" && 
      d.documentElement.clientWidth != 0)
      r = d.documentElement;
   else
   { 
     if (d.body && typeof d.body.clientWidth == "number")
        r = d.body;
   }
}

function winsize()
{
   var oh,sy,ow,sx,rh,rw;
   if (domWw)
   {
      if (d.documentElement && d.defaultView && 
         typeof d.defaultView.scrollMaxY == "number")
      {
         oh = d.documentElement.offsetHeight;
         sy = d.defaultView.scrollMaxY;
         ow = d.documentElement.offsetWidth;
         sx = d.defaultView.scrollMaxX;
         rh = oh-sy;
         rw = ow-sx;
      }
      else
      {
         rh = r.innerHeight;
         rw = r.innerWidth;
      }
      h = rh;
      w = rw;
   }
   else
   {
      h = r.clientHeight;
      w = r.clientWidth;
   }
   y = Math.floor(h/2);
   x = Math.floor(w/2);

   xy = (w >= h)?w:h;
}

function scrl(yx)
{
   var sy,sx;
   if (domSy)
   {
      sy = r.pageYOffset;
      sx = r.pageXOffset;
   }
   else
   {
      sy = r.scrollTop;
      sx = r.scrollLeft;
   }
   return (yx == 0)?sy:sx;
}

function dsply()
{
   step += 15;
   currentStep += step;

   txt.top = y + Math.floor(-currentStep/16) + pix;
   txt.left = x + Math.floor(-currentStep/2) + pix; 
   txt.width = currentStep + pix;
   txt.fontSize = Math.floor(currentStep/8) + pix;
   txt.color = col[clrPos];
   d.getElementById("_txt"+idx).firstChild.data = msg[msgPos];
   if (currentStep > xy * xyz)
   {
      currentStep = 10;
      step = 8;
      msgPos += jog;
      clrPos += jog;
   }
   if (clrPos >= col.length)
   { 
      clrPos = 0;
   }
   timer = setTimeout(dsply,spd);
   if (msgPos >= msg.length)
   {
      running = false;
      box.width = 1 + pix;
      box.height = 1 + pix;
      box.visibility = "hidden";
      txt.width = 1 + pix;
      txt.height = 1 + pix;
      txt.visibility = "hidden";
      clearTimeout(timer);
   }
   box.top = scrl(0) + pix;
   box.left = scrl(1) + pix;
}

function dims()
{
   if (domWw) box.width = "100%";
   else box.width = w + pix;
   box.height = h + pix;
}

function init()
{
   winsize();
   box = document.getElementById("_box"+idx).style; 
   txt = document.getElementById("_txt"+idx).style;
   dims();
   dsply();
}

function rsz()
{
   if (running)
   {
      winsize();
      dims();
   }
}

if (window.addEventListener)
{
   window.addEventListener("resize",rsz,false);
   window.addEventListener("load",init,false);
}  
else 
if (window.attachEvent)
{
   window.attachEvent("onresize",rsz);
   window.attachEvent("onload",init);
} 

</SCRIPT>

resul hacıoğlu  / lazcocuk
lazcocuk_resul@hotmail.com


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.