Jquery learning notes-jQuery implements click and mouse event sensing, jquery-jquery
For click events, jQuery also provides a dynamically alternating toggle () method. This method accepts two parameters, both of which are listener functions and are used in the click events.
JQuery learning Summary (2). jquery learning Summary
Next to jQuery summary in the previous blog (I), jQuery always gives me too much convenience, conciseness, and a little bit of fragmentation. Therefore, we need to make a good summary to concatenate the scattered elements into lines, combine the previous JS Code to b
When using libraries such as jquery, developers often use selectors to access and manipulate elements in the DOM. When a choice is repeatedly accessed on the page, it's a good idea to cache it for better performance.
Let's take a look at an example,
jquery (document). Ready (function () {
jquery (' #some-selector '). On (' hover ', function () {
Jquery-1.4.2.min.js is optimized, and query-1.4.2.js is easy to develop and read, detailed Xiangxiang read this article, hope to help you just began to contact JQuery, download the file including jquery. vsdoc. js, jquery. min. js and jquery. js is not very clear about the r
$first. On (' click ', function () {
$first. CSS ({
' Border ': ' 1px solid red ',
' Color ': ' Blue '
});
});
Copy CodeChained operationThe chained operation of the jquery implementation method is very easy. Use this point below.
Bad
$second. HTML (value);
$second. On (' click ', function () {
Alert (' Hello everybody ');
});
$second. FadeIn
JQuery Reading Notes --- Ajax in jQuery -- serialization elements, Ajax global events, jquery --- jquery
Serialize () method:
Acting on a jQuery object, it can serialize the content of DOM elements into strings for Ajax requests.
Ajax global events:
Method Name
Use jQuery to create a simple example of the effect of the mask layer pop-up, jquery is simple
The customer's website suddenly needs a masked pop-up window effect, which can also be called a dark box. The specific effect is that the background on the webpage becomes translucent, and a menu or something appears in the middle of the screen. This effect is very common on the Internet, for example, browsing the
JQuery animation effect summary and jquery animation Summary
1. animation method description
Method Name
Description
Hide () and show () Methods
You can modify multiple style attributes, that is, height, width, and opacity.
FadeIn () and fadeOut () Methods
Only change opacity
SlideUp () and slideDown () Methods
Only
1.jquerybasic syntax middot=chainprogramming example (quot=nvidiv1quot=#.show(=.css ( quot; color quot;: quot; red quot;) middot; use a ready event as the start to process HTML documents. $ (document ). ready (function () {// write your generation here
1. Basic jQuery syntax
· Chained programming $ ("# div1" ).show().css ("color": "red ")
· Use a ready event as the start to process HTML documents.
$ (Document). ready (function (){
// Write your co
Sharp jQuery Reading Notes --- Ajax in jQuery -- get, post, and other methods, jquery --- jquery
The load () method is usually used to obtain static data files from the Web server. However, this does not reflect the full value of ajax.
In a project, if you need to pass some parameters to the page on the server, you ca
First, select the page elementsThe basic design and primary usage of jquery is "select a page element and then do something about it." This is the fundamental feature that distinguishes it from other library functions.The first step in using jquery is often to put a select expression into the constructor jquery () (abbreviated $) and get the selected element.
Se
In WEB projects, jQuery is often used for AJAX requests. after net3.5, the previously written request statements have some minor issues, that is, the returned results are always xml, rather than JSON. add the contentType: "application/json; charset = UTF-8" option in ajax.. net 3.5 and later, you must check the contentType. net will not return JSON, so our request will naturally be unable to request JSON data. The correct method is as follows:
The C
(function () {$first. css (' border ', ' 1px solid red '); $first. CSS (' Color ', ' Blue ');}); $first. Hover (function () {$first. css (' border ', ' 1px solid Red ');})Suggested $first.on (' click ', Function () {$first. css (' border ', ' 1px solid red '); $first. CSS (' Color ', ' Blue ');}) $first. On (' hover ', function () {$first. css (' border ', ' 1px solid Red ');})Thin JavaScriptIn general, it is best to combine functions as much as possible.Bad $first.click (function () { $firs
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.