This article mainly introduces JavaScript and jquery mouse mouse event bubbling, this article summarizes some of the findings of the mouse event, and gives the JavaScript and jquery test code, the need for friends can refer to the
Simple Mouse Movement Events:
Enter
The code is as follows:
MouseEnter: Not bubbling
MouseOver: Bubbling
The MouseOver event is triggered regardless of whether the mouse pointer crosses the selected element or its child elements
The MouseEnter event is triggered
JavaScript has a very important function, which is event-driven. When the page is fully loaded, the user triggers the element of the bound event in the page by the mouse or keyboard. JQuery is a more efficient way for developers to write event behavior, encapsulating a number of useful event methods for our use.A Binding eventsIn the course of JavaScript learning, we have mastered a lot of events used, commonly used events are: Click, DblClick, MouseDown, MouseUp, MouseMove, MouseOver,
1. Event binding--bind (TYPE,[PARAMS],FN)Type: Event types, including Blur,focus,load,resize,scroll,unload,click,dbclick,mousedouwn,mouseup,mousemove,mouseover,mouseout , Mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error,Params: Optional parameter, an extra data object that is passed to the event object as the value of the Event.data propertyfn: handler function for bindingThe time binding type in *jquery is less than normal java
means to hide the Tip when you click an external element.In ReadyShow, when hidden by clicking, _ fCH is bound to the click Event of the document:This. IsTouch (trigger. HideType) addEvent (this. _ trigger. Elem, "mouseout", this. _ fTH );Note that the hidden binding event should be put in ReadyShow, rather than Show, because the hidden event may be triggered when the delay is not displayed._ FCH is an attribute defined during initialization. It is
Summary of events and animations in jQuery, and summary of jquery events
1. Load DOM
1.1.window event
Window. onload = function () {}...... timing: After loading all other resources, execute$ (Function (){})...... : Just wait until the tag is complete.
Difference: the former can only parse the last one in the HTML page, and the second is N
window.onload() = function () { } $(function () { $("li").bind("click", function () { $(this).css("background","red")
This article mainly introduces the usage of DOM Event binding in JQuery, and analyzes the bind method binding related skills. For more information, see the following example. Share it with you for your reference. The specific analysis is as follows:
After the document is loaded, if you intend to bind events to the elements to complete some operations, you can use the bind () method to bind specific events to the matching elements, bind () method call format:
Bind (type [, data], fn );
The bind
; Effect Preview5. Add mouse to move out the range, automatically locate the current activation element function;Before doing this function, the first thought, the mouse move out of the operation, we can think of Mouseout,mouseleave event, then there will be the following several questions:
① which event does this place use to satisfy this condition?
② which element does the selected event locate?
How do yo
standardEvent.delta = event.wheeldelta/120; //Add custom properties Delta resolves compatibility issues}Callback.call (obj,event); //The Event.delta property value here is compatible with all browsers, the previous lap is 1, and the next lap is-1. While the Event.wheeldelta attribute still has problems in the OPERA9 series and in the early safari, it is normal in other browsers, the last lap is 120, the next lap is- .})}The loading of the wheel Event trigger page is a technical point to be know
A Binding eventsIn the course of JavaScript learning, we have mastered a lot of used events, commonly used events are: Click, DblClick,MouseDown, MouseUp, MouseMove, MouseOver, mouseout, change, select, Submit, KeyDown,KeyPress, KeyUp, Blur, focus, load, resize, scroll, error. Then there are more events to refer toThe events section of the manual.JQuery uses the. bind () method to bind these events to an element. Three parameters can be passed: Bind (
, the _fch is bound to the Click event of the document:
This. Istouch (trigger. Hidetype) addevent (This._trigger. Elem, "Mouseout", this._fth);
Notice that the hidden binding event is placed in the readyshow instead of the show, as the latency may not have been displayed and triggered the hidden event.
Where _fch is a property that is defined during initialization, for adding and removing click-Behind events:
Copy Code code as follows:
() {
var elem = this,
fn = function () {Over.call (elem)};
Cleartimeout (Data[group]);
Data[group] = settimeout (FN, speed);
});
Addevent (Elem, ' mouseout ', function () {
var elem = this,
fn = function () {Out.call (elem)};
Cleartimeout (Data[group]);
Data[group] = settimeout (FN, speed);
});
};
}) (' Hoverdelay ');
Data is responsible for saving a custom "group" under the same "group" that can even suspend the
This example describes the DOM event binding usage in jquery. Share to everyone for your reference. The specific analysis is as follows:
After the document is loaded, if you intend to do something for the element-binding event, you can use the bind () method to bind the matching element to a specific event, and the Bind () method is called in the following format:
Bind (Type [, data], FN);
The bind () method has 3 parameters, as described below.
The 1th parameter is the event type, which inc
Usage of DOM Event binding in JQuery: jquerydom
This document describes how to bind a DOM Event in JQuery. Share it with you for your reference. The specific analysis is as follows:
After the document is loaded, if you intend to bind events to the elements to complete some operations, you can use the bind () method to bind specific events to the matching elements, bind () method call format:
Bind (type [, data], fn );
The bind () method has three parameters, which are described as follows.
The 1
example is the difference between the MouseEnter event and the MouseOver event.HTML code for// (6) Mouseout events, MouseLeave eventsBoth the Mouseout event and the MouseLeave event are triggered when the mouse leaves a node.The difference between the two is that the Mouseout event will bubble and the MouseLeave event will not. The
space to be directly accessible to the mouse).
It is important to note that in theory the mouseenter of the parent element should be triggered before the mouseenter of the child element, but not necessarily in Chrome42. When the parent element has no space to be directly touched by the mouse, the mouse moves directly into the child element, first triggering the child element's mousenter, and then the parent element's MouseEnter.The difference between MouseLeave and mouseoutBoth of these ar
(this. CheckShow (trigger )){This. ReadyShow (this. IsClick (trigger. ShowDelayType ));} Else {ClearTimeout (this. _ timer );};};})); First, you can use ClickShow to determine whether to click the display, and then use CheckShow to check whether the same trigger object exists.The CheckShow program is as follows:Copy codeThe Code is as follows:If (trigger! = This. _ trigger ){This. Hide (); this. _ trigger = trigger; return true;} Else {return false ;}; If it is not the same trigger object, exec
After the document is loaded, if you intend to do something for the element-binding event, you can use the bind () method to bind the matching element to a specific event, and the Bind () method is called in the following format:
Bind (Type [, data], FN);
The bind () method has 3 parameters, as described below.
The 1th parameter is the event type, which includes: Blur, focus, load, resize, scroll, unload, click, DblClick, MouseDown, MouseUp, MouseMove, MouseOver,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.