¾È±Ô °øºÎ¹æ

Javascript & JQuery & CSS > Jquery Event Handler Á¤¸®

µî·ÏÀÏ : 2017-07-04 19:52 Á¶È¸¼ö : 93,304

Event Handler?

¹öÆ°À» ´©¸£°Å³ª, Text¿¡ ±ÛÀÚ¸¦ ÃÄ ³Ö°Å³ª, ºê¶ó¿ìÀú°¡ »õ·Î¿î ¹®¼­¸¦ ÀÐ¾î µéÀ̰ųª, ºê¶ó¿ìÀú¸¦ ´Ý°Å³ª ÇÏ´Â °ÍµéÀÌ ¹Ù·Î À̺¥Æ®ÀÎ °ÍÀÌ´Ù. 

Ãʱ⿡ À¥ ȯ°æ, Á¤È®È÷ ¸»ÇÏÀÚ¸é, HTML¿¡¼­´Â ÀÌ·¯ÇÑ °ÍÀÌ ¾ø¾ú´Ù.

±×·¡¼­, »ç¿ëÀÚÀÇ ÀԷ¿¡ ¹ÝÀÀÇÏÁö ¸øÇÔ¿¡ µû¶ó À¥ ¼­¹ö¿Í ³×Æ®¿öÅ©¿¡ ºÎÇϸ¦ ÁÖ¾ú´ø °ÍÀÌ´Ù.

±×·¯ÇÑ ¹®Á¦ ¶§¹®¿¡ ÀÚ¹Ù½ºÅ©¸³Æ®°¡ Ãß°¡µÇ¸é¼­ ÀÌ·¯ÇÑ ¹®Á¦Á¡À» ÁÙ¿©ÁÖ¾ú´ø °ÍÀÌ´Ù.  

ÀÚ¹Ù½ºÅ©¸³Æ®¸¦ HTML¹®Àå¿¡ »ç¿ëÇÒ ¼ö ÀÖ°Ô µÇ¸é¼­, »ç¿ëÀÚÀÇ Çൿ¿¡ µû¶ó ÀûÀýÇÑ Á¶Ä¡¸¦ ÃëÇÒ ¼ö ÀÖ°Ô µÊ¿¡ µû¶ó HTML ¹®¼­ÀÇ ³»¿ë¸¸À» ´Ü¼øÈ÷ º¸¿©ÁÖ´Â

ºê¶ó¿ìÀúȯ°æÀ» ¹þ¾î³¯ ¼ö ÀÖ°Ô µÈ °ÍÀÌ´Ù.  Áï, ÀÚ¹Ù½ºÅ©¸³Æ®°¡ À̺¥Æ®¸¦ ó¸®(Handle)ÇÏ°Ô µÊ¿¡ µû¶ó HTML¹®¼­°¡ º¸´Ù µ¿ÀûÀÎ(Dynamic) ÆäÀÌÁö°¡ µÉ ¼ö ÀÖ¾ú´Ù.

´ëºÎºÐ À̺¥Æ®°¡ ¹ß»ýÇϸé, ÀÌ À̺¥Æ®¸¦ ó¸®(Handle)ÇÒ ¼ö ÀÖ´Â ÇÔ¼ö¸¦ ¸¸µé¾î¼­ ÇØ´ç À̺¥Æ®¿¡ ´ëÀÀÇÏ°Ô Çϴµ¥,

ÀÌ·¸°Ô À̺¥Æ®¿Í ó¸®ÇÔ¼ö¸¦ ¹­¾îÁÖ´Â °ÍÀ» À̺¥Æ® Çڵ鷯(Event Handler)¶ó°í ºÎ¸¥´Ù. 

´ÙÀ½Àº Jquery ¿¡¼­ »ç¿ëÇÏ´Â À̺¥Æ®ÀÇ Á¾·ù¿Í ±×¿¡ ´ëÇÑ ¼³¸íÀÌ´Ù.

 
Method Description
bind() Attaches event handlers to elements
blur() Attaches/Triggers the blur event
change() <input />, <textarea />, <select /> ¿ä¼ÒÀÇ °ªÀÌ º¯°æ µÇ¾ùÀ» ¶§
click() ¸¶¿ì½º¸¦ Ŭ¸¯ ÇßÀ» °æ¿ì
dblclick() ¸¶¿ì½º¸¦ ´õºíŬ¸¯ ÇßÀ» °æ¿ì
delegate() Attaches a handler to current, or future, specified child elements of the matching elements
die() Removed in version 1.9. Removes all event handlers added with the live() method
error() Deprecated in version 1.8. Attaches/Triggers the error event
event.currentTarget The current DOM element within the event bubbling phase
event.data Contains the optional data passed to an event method when the current executing handler is bound
event.delegateTarget Returns the element where the currently-called jQuery event handler was attached
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.namespace Returns the namespace specified when the event was triggered
event.pageX Returns the mouse position relative to the left edge of the document
event.pageY Returns the mouse position relative to the top edge of the document
event.preventDefault() Prevents the default action of the event
event.relatedTarget Returns which element being entered or exited on mouse movement.
event.result Contains the last/previous value returned by an event handler triggered by the specified event
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 Returns which DOM element triggered the event
event.timeStamp Returns the number of milliseconds since January 1, 1970, when the event is triggered
event.type Returns which event type was triggered
event.which Returns which keyboard key or mouse button was pressed for the event
focus() ¿ä¼Ò¿¡ Æ÷Ä¿½º µÇ¾úÀ»¶§
focusin() Attaches an event handler to the focusin event
focusout() Attaches an event handler to the focusout event
hover() ¸¶¿ì½º°¡ ¿ä¼Ò À§¿¡ À§Ä¡ ÇßÀ» ¶§
keydown() Å° ÀÔ·Â ½Ã, ¸ðµç Å°¿¡ ´ëÇØ Àû¿ë
keypress() Å° ÀԷ½à ¹ß»ý (enter, tabemdÀÇ Æ¯¼öÅ° Á¦¿Ü)
keyup() Å° ÀÔ·Â ÈÄ ¹ß»ý
live() Removed in version 1.9. Adds one or more event handlers to current, or future, selected elements
load() Deprecated in version 1.8. Attaches an event handler to the load event
mousedown() ¸¶¿ì½º ¹öÆ°À» ´©¸¥ ¼ø°£
mouseenter() ¼±ÅÃÇÑ ¿ä¼ÒÀÇ ¿µ¿ª¿¡ ¸¶¿ì½º°¡ À§Ä¡ ÇßÀ» °æ¿ì
mouseleave() ¼±ÅÃÇÑ ¿ä¼ÒÀÇ ¿µ¿ª¿¡¼­ ¸¶¿ì½º°¡ ¹þ¾î ³µÀ» °æ¿ì
mousemove() ¸¶¿ì½º°¡ À̵¿ÇÒ °æ¿ì ¹ß»ýµÇ´Â À̺¥Æ®
mouseout() ¼±ÅÃÇÑ ¿ä¼ÒÀÇ ¿µ¿ª¿¡¼­ ¸¶¿ì½º°¡ ¹þ¾î ³µÀ» °æ¿ì
mouseover() Attaches/Triggers the mouseover event
mouseup() ¸¶¿ì½º ¹öÆ°À» ³õ´Â ¼ø°£ ¹ß»ýµÇ´Â À̺¥Æ®
off() Removes event handlers attached with the on() method
on() Attaches event handlers to elements
one() Adds one or more event handlers to selected elements. This handler can only be triggered once per element
$.proxy() Takes an existing function and returns a new one with a particular context
ready() DOMÀÌ ¸ðµÎ Áغñ µÇ¾úÀ» ¶§
resize() Resize µÉ ¶§
scroll() HTML ¹®¼­³ª ¿ä¼Ò°¡ ½ºÅ©·Ñ µÇ¾úÀ» ¶§
select() ¼±ÅÃÇÑ °³Ã¼¸¦ ¸¶¿ì½º¸¦ ÅëÇØ ¼±Åà ÇÏ¿´À» ¶§
submit() submit ÀÌ ÀϾ ¶§
toggle() Removed in version 1.9. Attaches two or more functions to toggle between for the click event
trigger() Triggers all events bound to the selected elements
triggerHandler() Triggers all functions bound to a specified event for the selected elements
unbind() Removes an added event handler from selected elements
undelegate() Removes an event handler to selected elements, now or in the future
unload() Deprecated in version 1.8. Attaches an event handler to the unload event



 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
³ª±×³×    2019-03-20 14:30
»èÁ¦
¾ø¾îÁø À̺¥Æ® Çڵ鷯µîµµ Æ÷ÇÔµÈ°Í °°½À´Ï´Ù¸¸...
 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.