spacer

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

home / experts / javascript / column10


The Event Object

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

Internet Explorer 4.0x's event object is similar to the one in Navigator 4.0x. However, there are many differences between the two implementations.

The event object in Internet Explorer 4.0x is available only during an event. Therefore, you can only refer to it in event handler scripts and event processing functions. The event object is governed by the window object, so its formal syntax is window.event. The preceding window specification is not necessary in any version of JavaScript, so it may be omitted.

The event object represents the state of the event that is associated with the object at a given time, such as the element where the event occurred and the location of the mouse cursor.

The following example displays the current position of the mouse cursor (with respect to the browser window) in the status bar:

<SCRIPT LANGUAGE="JavaScript">
<!--

function displayLocation() {
  var str = "";
  str += "X=" + window.event.clientX;
  str += ", ";
  str += "Y=" + window.event.clientY;
  window.status = str; // display in status bar
}

document.onmousemove = displayLocation;

// -->
</SCRIPT>

If you're using Internet Explorer 4.0x, you've probably already noticed the running numbers in the status bar. We'll discuss the cross-browser version for this script and others in our next column, covering the "cross-browser event model."

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: December 30, 1997
Revised: December 30, 1997

URL: http://www.webreference.com/js/column10/eventobject.html