jQuery Event Methods
Event methods trigger, or bind a function to an event for all matching elements.
Trigger example:
$("button").click() - triggers the click event for a button element.
Binding example:
$("button").click(function(){$("img").hide()}) - binds a function to the click event.
The following table lists all the methods used to handle events.
| Method | Description |
|---|---|
| bind() | Add one or more event handlers to matching elements (이벤트 추가, 현재) * 기존객체만 이벤트지정 * |
| blur() | Triggers, or binds a function to the blur event of selected elements (포커스가 이동할때) |
| change() | Triggers, or binds a function to the change event of selected elements (값이 변경되었을때) |
| click() | Triggers, or binds a function to the click event of selected elements (클릭햇을때) |
| dblclick() | Triggers, or binds a function to the dblclick event of selected elements (더블클릭했을때) |
| delegate() | Add one or more event handlers to current, or future, specified child elements of the matching elements |
| die() | Remove all event handlers added with the live() function |
| error() | Triggers, or binds a function to the error event of selected elements (에러발생시 이벤트발생) |
| event.currentTarget | The current DOM element within the event bubbling phase |
| event.data | Contains the optional data passed to jQuery.fn.bind when the current executing handler was bound |
| event.isDefaultPrevented() | Returns whether event.preventDefault() was called for the event object |
| event.isImmediatePropagationStopped() | Returns whether event.stopImmediatePropagation() was called for the event object |
| event.isPropagationStopped() | Returns whether event.stopPropagation() was called for the event object |
| event.pageX | The mouse position relative to the left edge of the document (마우스 x좌표) |
| event.pageY | The mouse position relative to the top edge of the document (마우스 y좌표) |
| event.preventDefault() | Prevents the default action of the event |
| event.relatedTarget | The other DOM element involved in the event, if any |
| event.result | This attribute contains the last value returned by an event handler that was triggered by this event, unless the value was undefined (이벤트의 마지막값을 출력한다) |
| event.stopImmediatePropagation() | Prevents other event handlers from being called |
| event.stopPropagation() | Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event |
| event.target | The DOM element that initiated the event (접근한 타겟의 속성에 접근할수있다) |
| event.timeStamp | This attribute returns the number of milliseconds since January 1, 1970, when the event is triggered |
| event.type | Describes the nature of the event |
| event.which | Which key or button was pressed for a key or button event (키보드에서 어떤키를 눌럿는지 키넘버값을 출력) |
| focus() | Triggers, or binds a function to the focus event of selected elements (포커스가 갓을때 이벤트발생) |
| focusin() | Binds a function to the focusin event of selected elements (포커스가 들어갓을때) |
| focusout() | Binds a function to the focusout event of selected elements (포커스에서 빠져나올때 |
| hover() | Binds one or two functions to the hover event of selected elements (마우스를 올렷을때, 땟을때 이벤트 발생) |
| keydown() | Triggers, or binds a function to the keydown event of selected elements (키보드를 누르고있을때) |
| keypress() | Triggers, or binds a function to the keypress event of selected elements (삽입되엇을때?? 엔터쳣을때인거같다) |
| keyup() | Triggers, or binds a function to the keyup event of selected elements (키보드를 눌렀다가 뗏을때) |
| live() | Add one or more event handlers to current, or future, matching elements (이벤트를 지정할때, die()와 반대) |
| load() | Triggers, or binds a function to the load event of selected elements (로드됫을때, 문서나 이미지를 다 읽엇을때) |
| mousedown() | Triggers, or binds a function to the mouse down event of selected elements (클릭하고있을때, 클릭했을때) |
| mouseenter() | Triggers, or binds a function to the mouse enter event of selected elements (마우스커서를 올렸을때) |
| mouseleave() | Triggers, or binds a function to the mouse leave event of selected elements (마우스커서를 뗏을때) |
| mousemove() | Triggers, or binds a function to the mouse move event of selected elements (마우스커서가 이동할때 |
| mouseout() | Triggers, or binds a function to the mouse out event of selected elements (개체에서 마우스커서가 벗어낫을때) |
| mouseover() | Triggers, or binds a function to the mouse over event of selected elements (마우스커서를 올려놨을때) |
| mouseup() | Triggers, or binds a function to the mouse up event of selected elements (마우스를 클릭했다가 뗏을때) |
| one() | Add one or more event handlers to matching elements. This handler can only be triggered once per element (이벤트를 한번만 실행시킬때) * 한번만!!! * |
| ready() | Binds a function to the ready event of a document (when an HTML document is ready to use) (페이지가 완전이 로드되었을때 이벤트발생) |
| resize() | Triggers, or binds a function to the resize event of selected elements (윈도우창 사이즈 조절할때) |
| scroll() | Triggers, or binds a function to the scroll event of selected elements (스크롤바 움직일때) |
| select() | Triggers, or binds a function to the select event of selected elements (선택(블록지정) 햇을때) |
| submit() | Triggers, or binds a function to the submit event of selected elements (submit버튼 눌렀을때) |
| toggle() | Binds two or more functions to the toggle between for the click event for selected elements (토글방식으로 이벤트줄때) |
| trigger() | Triggers all events bound to the selected elements |
| triggerHandler() | Triggers all functions bound to a specified event for the selected elements (강제이벤트발생, 일치하는 첫번째요소만) |
| unbind() | Remove an added event handler from selected elements (bind한 이벤트 제거) |
| undelegate() | Remove an event handler to selected elements, now or in the future (delegate한 이벤트 제거) |
| unload() | Triggers, or binds a function to the unload event of selected elements (객체가 unload될때, 페이지 떠날때) |
'Front-End > jQuery' 카테고리의 다른 글
| jQuery mobile jQuery Mobile - 구조 & 문법 (0) | 2012.04.10 |
|---|---|
| Effect - Reference(API) (0) | 2012.04.06 |
| Selectors(접근) - Reference(API) (1) | 2012.04.06 |
| Selectors - this의 chlildNode 이동하기 (0) | 2012.04.06 |
| Selectors - 요약&정리 (0) | 2012.04.05 |