spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column22


Behavior Emulation with IE 4.0x

Developer News
HP to Microsoft: Thanks for Nothing
iPhone Remains Left Out as Android Scores Flash
The Year of Living the OpenSocial

In principle, Behavior functionality can be emulated with Internet Explorer 4.0x. In our example, a blinking image can be created using IE 4.0x's DHTML objects. Images can be moved and made invisible by manipulating their object's properties, such as visibility, left, and top attributes. Here is the full script:


<HTML>
<HEAD>
<TITLE> Soccer: World Cup is Over </TITLE>
</HEAD>
<BODY ONLOAD="soccerOnload()">
<DIV ID="soccer" STYLE="position:absolute; left:200; top:250"> -->
  <IMG SRC="bigsoccer.gif"></DIV>
<SCRIPT LANGUAGE="JavaScript">
var msecs = 2000;
var counter = 0;

function soccerOnload() {
  setTimeout("blink()", msecs);
}

function blink() {
  soccer.style.visibility =  -->
    (soccer.style.visibility == "hidden") ? "visible" : "hidden";
  counter +=1;
  if (counter == 10) {
    alert("Fifth Blink Point");
    counter = 0;
  }
  setTimeout("blink()", msecs);
}

</SCRIPT>
</BODY>
</HTML>

Notice we have added a small feature to our blinking soccer ball: an alert box that pops up every five blinks. We picked a simple event so it will be easier to explain later in this column how to implement an event with Behaviors.

http://www.internet.com

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script · Book Review: Content Rich
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Building Command Line Utilities with Python · fring Brings Mobility to Junction Networks' OnSIP · Another Big Win for Wi-Fi Positioning


Created: July 19, 1998
Revised: July 19, 1998

URL: http://www.webreference.com/js/column22/emulate.html