ONLINEGRAPHICPROOFING.COM

bat proof your house - www.onlinegraphicproofing.com

Menu


Alternatively, I can choose the Internet Explorer 6.0 option from the Show Events For submenu. Because Internet Explorer is a much newer


browser, it supports numerous events that weren't supported in older browsers. Figure 10.7 shows the long list of supported events for Internet Explorer 6.0. Figure 10.7. Events supported in the Internet Explorer 6.0 browser are much greater than those supported in older browsers.   Because Netscape 4.0 and Internet Explorer 4.0 browsers are still in use, Dreamweaver provides the 4.0 and Later Browsers option. Of course, the needs of your organization dictate which event set you use. If you're developing for the web and want to target the most people, choose either the 4.0 and Later Browsers option or the HTML 4.01 option. By default, Dreamweaver defaults to the HTML 4.01 option. You've probably noticed that the Events pop-up menu associated with a particular behavior contains events that are easy to understand just by their names and others that are not so easy to understand. Before we begin discussing the different types of events, let's quickly highlight the more popular events you might decide to use with your behaviors. For the most part, the following events are the ones you'll use most often: onClick: Event is fired and action is called when the object is clicked. onDblClick: Event is fired and action is called when the object is double-clicked. onMouseDown: Event is fired and action is called while the user's left mouse click is down. This event works great when you need to call an action repeatedly while the user holds the mouse button down (dragging an object, for instance). onMouseUp: Event is fired and action is called when the user's left mouse button is released. This event is similar to the onClick event. NOTE There is no practical difference between onClick and onMouseUp. onMouseUp is supposed to used with the <a> tag and onClick is supposed to be used with buttons. They are interoperable though.   onMouseOver: Event is fired and action is called when the user's mouse pointer rolls over an object. onMouseOut: Event is fired and action is called when the user's mouse pointer rolls out of an object. onFocus: Event is fired and action is called when the object is highlighted. For instance, if my cursor is in the address bar of the browser and I press Tab to highlight the next object (possibly an object in the document), the next object has focus and the address bar loses focus. onBlur: Event is fired and action is called when the object loses its highlight state. For instance, if my cursor is in the address bar of the browser and I press Tab to highlight the next object (possibly an object in the document), the next object has focus and the address bar loses focus. That loss of focus is the onBlur event. onLoad: Event is fired and action is called when the page is loaded. onUnLoad: Event is fired and action is called when the browser is closed or a different page is loaded. Now that you an idea as to what behaviors are, you're familiar with the Behaviors panel, you understand how behaviors are attached to objects, and you understand the fundamentals of events, let's move forward and begin outlining each behavior in detail. Call JavaScript You can use the Call JavaScript behavior when you want to write inline JavaScript for an object without having to switch to Code view. To demonstrate this behavior, let's add a Close Window button to the page. When the user clicks this button, we'll use one of the built-in JavaScript functions (close()), to