() function to filter all cells whose class is not "firstcolumn", we need to use the selection operation for the table again, can't we call Methods consecutively? Fortunately, jquery provides the end () function, which changes the list of matched elements to the previous state so that you can execute the method linked list:Copy codeThe Code is as follows: $ ('# mytable '). Find ('. firstcolumn '). CSS ('background', 'red '). End (). Find ('. lastcolu
document. This makes processing XML documents quite easy, and integrates content and data into your Web site. Listing 6 shows an extension of the success function, which adds a list item to a Web page for each Listing 6. Using JQuery to process XML documents
Success:function (XML) {
$ (XML). Find (' item '). each (function () {
var Item_text = $ (this). text ();
$ (' . HTML (Item_text)
. Appendto (' ol ');
});
}
Add animations to HTML
You can use
the selection operation for the table again, can't we call Methods consecutively? Fortunately, jQuery provides the end () function, which changes the list of matched elements to the previous state so that you can execute the method linked list:Copy codeThe Code is as follows:$ ('# Mytable '). Find ('. firstColumn '). Css ('background', 'red '). End (). Find ('. lastColumn '). Css ('background', 'blue '); It is also easy to write a custom
$ (selector). MouseOver (function)
Mouse hover event that triggers or binds a function to the selected element
Full jquery event: http://www.w3school.com.cn/jquery/jquery_ref_events.asp
Conventions:
Put all jQuery code in the event handler
Place all event handlers in the document-ready event handler
Put the
a CSS selector:
$ (Document) // select the entire document object $ ('# myid') // select the webpage element whose ID is myId $ ('div. myclass') // select the div element $ ('input [name = first] ') whose class is myClass. // select the input element whose name attribute is equal to first.
It can also be a jQuery-specific expression:
$ ('A: first ') // select the first a element in the webpage $ ('tr: odd') // select an odd row of the table $ (' # my
it.jQuery.fn.init.prototype.init.prototype.init...If you want to write it all the time.Ii. jQuery framework
Version: 2.0.3
// You can use jQuery or $ to find jQuery (function (window, undefined) {(96,283) defines some variables and functions jQuery = function) add methods and attributes to the JQ object (285,347) exte
acceleration to 50%, then reduce the speed to complete the animation.
How to apply:Slideup|slidedown|slidetoggle|fadein|fadeout|fadetoggle$ (Element). Slideup (Duration,easing,[callback]);FadeTo$ (Element). FadeTo (Duration,opacity,easing,[callback]);Animate$ (Element). Animate ({properties},duration,easing,callback);The jquery1.4+ version can also:$ (Element). An
BKJIA recommended topic: jQuery parade
CSS style property Animation
We now have a lot of animation methods, such as sliding, fade-out, and other hide and show animations, but we still don't know how to precisely control the animations and how they happen. Here we will introduce a very powerful jQuery function, animate. This method allows you to animation any CSS
parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or millisecond.The required opacity parameter in the fadeTo () method sets the fade-in and fade-out effect to a given opacity (value between 0 and 1 ).The optional callback parameter is the name of the function executed after the function is completed.6.5-Upper and Lower slide functions:$ (Selector). slideDown (speed, callback); -- slide down;$ (Selector). slideUp (speed, callback); -- slide up;$ (
(){If ($ (this). attr ('href '). match ('evil') {// if it is identified as a harmful link
E. preventDefault (); // block open
$ (This). addClass ('evil '); // Add harmful class
}
});
There are two ways to automatically trigger an event. One is to directly use event functions, and the other is to use. trigger () or. triggerHandler ().
$ ('A'). click ();
$ ('A'). trigger ('click ');
9. Special Effects
JQuery allows objects to present certain s
| demoLearn how to create a simple, but elegant menu by animating background with jquery backgroundposition plugin. It's simple, but the effect is really good.
Clean and attractive jquery vertical menu tutorial | demoCheck out this jquery vertical menu. It uses jquery animate
JQuery beginners (3): jquery beginners
3. Events and animations
A. Events
Aa. DOM Loading
1. Why use jQuery to load the DOM method?
Use the javascript window. the onload () method is required to load the DOM by waiting until all resources on the requested page are loaded to add event behavior to the DOM element. jquery
This article is the official HTML5 training course for Brother Lian it educational institution, the main introduction: JQuery Intensive Tutorial--jquery easingFrom the jquery API documentation, you can learn about the functions of jquery custom animations. Animate (propertie
This article is Brother LianIT Education Agency officialHTML5 Training tutorials, the main introduction: JQuery Intensive Tutorial--jquery easingfrom the jquery API documentation, you can learn about the functions of jquery custom animations. Animate (properties [, duration
The JQuery animate () method allows you to create custom animations.Examples of jQuery animationsJquery
JQuery Animation-Animate () methodThe JQuery animate () method is used to c
Created by American John Resig, JQuery has attracted many JavaScript gurus from around the world to join its team. jquery is another excellent JAVASCRĪPT framework following prototype. Its classic slogan is "Write less, does more" (write fewer code, do more things). jquery is a lightweight JS library (only 21k after compression), this is not the other JS library,
Created by American John Resig, JQuery has attracted many JavaScript gurus from around the world to join its team. jquery is another excellent JAVASCRĪPT framework following prototype. Its classic slogan is "Write less, does more" (write fewer code, do more things). jquery is a lightweight JS library (only 21k after compression), this is not the other JS library,
() and hide () methods show and hide elements. Use toggle () to switch between display and hide
$ (". Btn1"). click (function () {$ ("div"). show ();});
$ (". Btn2"). click (function () {$ ("div"). hide ();});
If the show and hide methods do not contain parameters, they are immediately displayed and hidden. If the speed parameter is specified, the system dynamically displays and hides the parameters at a specified time, in milliseconds, you can also use three built-in speeds: fast (200 ms), nor
) // ensure that an array is stored.Q = jQuery. data (elem, type, jQuery. makeArray (data ));Else if (data) // then add something to the dataQ. push (data );}Return q;},Dequeue: function (elem, type ){Var queue = jQuery. queue (elem, type ),Fn = queue. shift (); // then delete one. In the early stage, it was the callback for placing the animation. Delete it and c
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.