you ordered the Green shirt!

you ordered the Yellow shirt!

you ordered the Purple shirt!

Event handling

 

 

 

 

 

 

 

 

Overview

The two major issues to consider with events are a) accessing event information and b) knowing which events are supported for the various DOM elements. The major discrepancies exist between Microsoft and Netscape. In some cases you can avoid the problem through using a subset of features, but in other cases you will simply have to code in support for multiple browsers.

 

Browser Support
IE5.x/Win Event.srcElement allows you to find the element receiving the event trigger. Excellent support events associated with most HTML elements as defined in the W3C specification.
IE5.x/Mac As with the Windows version, event.srcElement is supported as is relatively good event support for HTML elements.
NS4.x/Win NS4.x supports event.target to access the element receiving the event trigger. Some event support is missing from a variety of HTML elements (i.e. onClick for the <IMG> tag).
NS6.x/Win Use event.target to access the element receiving the event trigger. Excellent support for events associated with most HTML elements as defined in the W3C specification

Recommended Solution

Try to avoid event code that is critical to your site and only works in version 5+ browsers. Embellishments to your site can be handled through event code without impacting older browsers.


 

if (isNav)
{
document.captureEvents(Event.MOUSEDOWN |
Event.MOUSEMOVE | Event.MOUSEUP)
}


These are Event handlers - they specify an action or sequence when an event happens.

 

For Netscape3 - you need to specifiy a capture.Events anytime you want access to any events: (set this up in the "onload" attribute for the body tag:

 

function init()
{
	if(isNav)
	{
		setNSEventCapture()
	}
	document.onmousedown = grabProduct
	document.onmousemove = dragProduct
	document.onmouseup = releaseProduct
}	



function setNSEventCapture()
  {
  if (isNav)
  {
  document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
  }
  }
  
Now you will have a grapProduct function, a dragProduct function and a releaseProduct function