Jquery, as a lightweight JS framework, has its unique advantages. Many web programmers are happy. In addition to rich client processing and animation functions. It also provides custom extension interfaces for more people to develop extension jquery. Use a simple example to demonstrate this interface. I think this is enough for many people to understand the path.
This example analyzes the use of the jquery on () method. Share to everyone for your reference. The specific analysis is as follows:
The use of the JQuery on () method:On (EVENTS,[SELECTOR],[DATA],FN)Events: One or more space-delimited event types and optional namespaces, such as "click" or "Keydown.myplugin".Selector: A selector string is used for the descendan
One, about mouse hover event and delay
A mouse event is one of the most common events on a Web page. Simple hover can be implemented with Css:hover pseudo class, with JS for complex points.
In general, we do not delay processing the mouse hover event. However, sometimes, in order to avoid unnecessary interference, the mouse hover events are often delayed processing. The so-called interference, that is, when the user mouse inadvertently touch a link, tab, or other areas, this does not show hidde
The Echarts map is mainly used for visualization of geographic area data and displaying data distribution information of different regions. Echarts Official website provides maps of China, the world map and other map data download, through JS introduction or asynchronous Load JSON file form call map.Echarts Map Application: Asynchronously read data using jquery and PHP, MySQL
This article will be combined with an
events
$(document).ready(function(){ $("p").on("myOwnEvent", function(event, showName){ $(this).text(showName + "! What a beautiful name!").show(); }); $("button").click(function(){ $("p").trigger("myOwnEvent",["Anja"]); });});
Transfer data to functions
function handlerName(event) { alert(event.data.msg);}$(document).ready(function(){ $("p").on("click", {msg: "You just clicked me!"}, handlerName)});
Applicable to uncreated elements
$(document).ready(function(){ $("p").on("click","p",f
, you can set multiple css attributes at a time.The returned result is still wrapped set to facilitate JQuery chained operations.For example: The code is as follows:Copy code $ ('Div: eq(0w.'hangzhou.css ({'Font-size': '2em ','Color': '# cc00ff'}); It is depressing that the attribute name of this Object must be enclosed in quotation marks as a string, otherwise i
The jquery input box is used to search for the example code of the keyword and highlight the color.
The instance code is as follows:
Note:
1. Not applicable to buttons, a, img, etc.
2. show. bs. popover: this event is triggered immediately when the show instance method is called.
Shown. bs. popover: this event is triggered when the pop-up dialog box is complete (it will wait until the CSS transition effect
1. sleep should not be used. javascript does not have multiple threads, and sleep will be blocked.You can refer to this question to illustrate the principle that js is a single thread.You should change your mind and use setInterval to implement loops .. The code is as follows: Copy code $ ("# List div. left"). mouseover (function (){Var item = $ (this). attr ("id ");// Al
JQuery binding event listening bind and removing event listening unbind usage example details, jqueryunbind
This article describes how to bind events to listen to bind and remove events to listen to unbind. We will share this with you for your reference. The details are as follows:
The post-bind (eventType, [data], Listener) // data is used as the optional parameter here. one () Events bound to this method
Example of how jQuery's live () method handles hover events
A method that imitates the hover event. When you move the cursor over a matched element, the specified first function is triggered.
Hover ([over,] out)
A method that imitates a hover event (move the mouse over an object and remove it)
When you move the cursor over a matching element, the specified first function is triggered.
When you move the cursor out of this element, the specified sec
two things, one is to create a div with the title content when the mouse is over the hyperlink, but to remove the div when the mouse hovers over the link.
At this time obviously need to use the mouse method, where to choose MouseOver and mouseout, or MouseEnter and MouseLeave. When it comes to small inserts, popular science promotes the difference between the above two sets of methods:
The function of the above two sets of methods is to trigger an
This example describes the use of the jquery hints effect. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
$ (function () {$ (". ToolTip"). MouseEnter (function (e) {This.mytitle=this.titleThis.title= ""var a= "$ ("Body"). Append (a);$ ("div"). css ({"Top": (E.pagey + y) + "px","Left"
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.