Home » JavaScript » Fast learning JQuery learning notes during the sum...

Fast learning JQuery learning notes during the summer vacation

just learning JS, and then JQurey, w3school on the description of JQ is this: JQ is a JS library, JQ greatly simplifies the programming of JS, JQ is very easy to learn (funny). I believe that w3school will not deceive me. Just after studying HTML, CSS, JS and I immediately strike the iron while it is hot to learn JQ. To begin soon happy trip to JQ, quack.


first is what JQ can do (often in learning time will forget their original intention, namely, we learn that we get what we should grasp what.). First JQ to HTML elements selection and operation, can operate on the CSS, you can operate on HTML, you can use the JS the special effects and animation, can traverse and modified on HTML DOM AJAX Utilities. JQ, indeed, can HTML, CSS, JS operation, so when the JQ is equivalent to before learning a fusion of.


Of course

before the JQ we have JQ library. This can download directly to the JQ website. Downloaded on a special web folder, so you can easily download. After the end of JQ (JQ is actually a.Js file) so before use, it should be cited by Html generally speaking .

in the element

since w3school description is to achieve maximum functionality with minimal code, so he is how to achieve it? $JQ in the first basic grammar learning know before (selector) (.Action). The $is the definition of JQ symbols, selector query and search of HTML elements, and action (Executive) the elements of the operation. (a point to note is that selector can have this, on behalf of the current element, a bit like C in the this pointer. The rest of the class like id ah ah, and before all the same.). In the JQ code which will generally have the document ready function ($(document).Ready (function () {}):))) in order to prevent the operation of JQ code before the document is fully loaded. But one thing is the problem of matching brackets here. Because of the use of TXT programming, no CB tips, in parentheses matching will be very bad heart.


in CSS has been introduced in.JQ and CSS selector selector inside the difference is not too much. To achieve the selected $in brackets ("P") that selects

elements. (selector), $("[href]") that selects the element with the href attribute (attribute selection. Optional device), $("P") (".Css") (CSS selector). In the CSS selector, you can set up a number of attributes (general format, attribute value, attribute: {value:..} braces. Don't forget).


The event handling method.JQ

JQ event function is the core function of $JQ. Generally refers to the event handler method calls when certain events in HTML. Usually the JQ code is in .



$(document).Ready (function () {
$("button").Click (function () {)
$("P").Hide ();
});
};

The above code can display the $JQ of the event ("button") (.Click (function) {}) is that when click the button below the executive function elements. The button is generally JS

Latest