Electric Type

Multimedia

About Us

News

Help

fly.htc source <EVENT id=finished name=onFinishedFly />
<method name=tick />
<method name=startFly />
<property name=from />
<property name=fromX />
<property name=fromY />
<property name=delay />

<script language="jscript">
var currCount;
var flyCount;
var flying;
var msecs;
var oTop, oLeft;

msecs = 50;
flyCount = 20;
flying = false;

style.position = "relative";
style.visibility = "hidden";
style.display = "none";

window.attachEvent("onload", onload);

function onload()
{
 // delay commences from the window.onLoad event
 if (delay != "none")
 {
  window.setTimeout(uniqueID+".tick()", delay);
 }
}

function tick()
{
 if (flying == false)
 {
  startFly();
 }
 else
 {
  doFly();
 }
}

function startFly()
{
 if (fromX==null && fromY==null)
 {
  if (from=="top")
  {
  style.posTop = -offsetTop-offsetHeight;
  }
  else if (from=="bottom")
  {
  style.posTop = element.document.body.clientHeight;
  }
  else if (from=="right" )
  {
  style.posLeft = element.document.body.clientWidth;
  }
  else
  {
  style.posLeft = -offsetLeft-offsetWidth;
  }
 }
 else
 {
  style.posTop = fromY;
  style.posLeft = fromX;
 }

 style.visibility = "visible";
 style.display = "";
 flying = true;

 oTop = style.posTop;
 oLeft = style.posLeft;

 currCount = 0;
 doFly();
}

function doFly()
{
 var dt, dl;

 currCount++;
 dt = oTop / flyCount;
 dl = oLeft / flyCount;

 style.posTop -= dt;
 style.posLeft -= dl;

 if (currCount < flyCount)
 {
  window.setTimeout(uniqueID+".tick();", msecs);
 }
 else
 {
  style.posTop = 0;
  style.posLeft = 0;
  flying = false;
  evObj = createEventObject();
  evObj.setAttribute("resulty", uniqueID);
  finished.fire(evObj);
 }
}

</script>

Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.