JQuery mouse events

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Mouse event is triggered when the user moves the mouse cursor or use any mouse button click.

   (1):The click event: click event to the user in the element on the left mouse button, triggering and release the left mouse button in the same element.

$('p').click(function(){

alert('click function is running !');

});

(2):The dbclick event: dbclick event trigger after finished quickly two clicks continuous at the user, the double-click speed depends on the operating system settings. General double is not frequently used in the page.

$('p').dbclick(function(){

alert('dbclick function is running !');

});

(3):The MouseDown event: MouseDown event in the user click the mouse button, not the same as with the Keydown event, the event is triggered only when the mouse is pressed in the.

$('p').mousedown(function(){

alert('mousedown function is running !');

});

(4):The mouseup event: mouseup event in the user releases the mouse, if released in the same and press the mouse element, then click events will trigger.

$('p').mouseup(function(){

alert('mouseup function is running !');

}).click(function(){

alert('click function is running too !');

});

(5):The mouseover event: mouseover event to the user the mouse from one element to another element is triggered, if need to know from the elements can be used, the relatedTagrget property.

(6):The mouseout event: mouseout event to the user to trigger the mouse out of a single element, which includes from the parent element to move to the sub elements, or using the keyboard to jump elements.

(5)And (6) the two events are generally not used, it is difficult to realize the interaction with the user, is not easy to capture user events.

(7):The mouseenter event: mouseenter event is triggered in the user's cursor into the elements.

$('p').mouseenter(function(){

alert('mouseenter function is running !');

});

(8):The mouseleaver event: mouseleaver event is triggered when the user leaves the elements in the cursor.

$('p').mouseleaver(function(){

alert('mouseleaver function is running !');

});

(7)And (8) the two events together, use the hover function to replace the two functions in jQuery.

  $('p').hover(function(){

alert('mouseenter function is running !');

},function(){

alert('mouseleaver function is running !');

  });

 Come from: http://hi.baidu.com/yejiejay/blog/item/19374ffb69a064076d22eba3.html

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Barbara at November 23, 2013 - 10:41 PM