$ (' input '). Bind (' click ', Function (e) {
Alert (E.type)//result is click
Alert (typeof E.type)//Returns a string
})
Target is the DOM that gets the trigger element, the trigger element, which is the one you ordered.
Currenttarget gets the DOM of the listener element, which is the one you're bound to.
For example:
$ (' div '). bind (' click ', Function (e) { alert (e.target); When the mouse clicks on the div area, it pops up an object htmldivelement
When the mouse clicks on the span area, it pops up objecthtmlspanelement
$ (' div '). bind (' click ', Function (e) { alert (e.currenttarget); When the mouse clicks on the div area, it pops up an object htmldivelement
When the mouse clicks on the span area, it pops up objecthtmldivelement
$ (' div '). MouseOver (function (e) { alert (e.relatedtarget); When the mouse moves out of the span area to the Div area, an object is ejected htmlspanelement
When the mouse moves from the div area into the span area, it pops up objecthtmldivelement
Mainly in the process of moving the mouse to move the previous element and mouseout the opposite, is the end of the mouse movement process of the element of the stay
<div style= "Width:200px;height:200px;background: #ccc;" ><span style= "Width:100px;height:100px;background:red;display:block;" ></span></div>
Data usage
$ (' div '). bind (' click ', 123,function (e) { alert (e.data); Pop-up Result 123}) The argument can be an array, a string, an object
Page Origin: The upper-left corner of the visible area (consistent with the viewport where the scroll bar is not present)
Display: Entire browser, including toolbar
Viewport: Visible area (the area where the page is normally browsed, excluding toolbars)
The green area is the display, the red area is the viewport, the origin of the page is orange, when the scroll bar appears, Pagey and clienty are not the same, Pagey also need to add the distance between the scroll bar and the top
jquery Learning Essays (Event objects)