spacer

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

home / experts / javascript / column22


Behavior Emulation with IE 4.0x

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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

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