cycling jQuery_Succinctly | Page 72

Event object attributes          event.type event.target event.data event.relatedTarget event.currentTarget event.pageX event.pageY event.result event.timeStamp Event object methods       event.preventDefault() event.isDefaultPrevented() event.stopPropagation() event.isPropagationStopped() event.stopImmediatePropagation() event.isImmediatePropagationStopped() To access the normalized jQuery event object, simply pass the anonymous function, passed to a jQuery event method, a parameter named "event" (or whatever you want to call it). Then, inside of the anonymous callback function, use the parameter to access the event object. Below is a coded example of this concept. Sample: sample67.html Grokking event namespacing Often we will have an object in the DOM that needs to have several functions tied to a single event handler. For example, let's take the resize handler. Using jQuery, we can add as many functions to the window.resize handler as we like. But what happens when we need to remove only one of these functions but not all of them? If we use $(window).unbind('resize'), all functions attached to the window.resize handler will be removed. By namespacing a handler (e.g. resize.unique), we can assign a unique hook to a specific function for removal. 72