! ");}); (4)
These are common methods. get and post are used in the same way. The first parameter is the url of the asynchronous request, the second parameter, and the third callback method.
Methods 3 and 4 are bound to the specified Dom object to respond to events executed by ajax. Of course, jquery's AJAX-related functions are not only these, but you can study them more if you are interested.
7. fade in and outCode
The Code is as follows:
$ ("# Msg").
This article summarizes 15 jquery development techniques and tips that are worth the attention of developers. Very incisive and practical! Share to everyone for your reference, specific as follows:
In this article, we'll introduce 15 techniques to make your jquery more effective, most of which are about performance improvement, and I hope everyone will like it!
1. Try to use the latest version of the
This article mainly introduces jQuery animation effect-related methods, and analyzes in detail the common methods and precautions for jQuery animation effect based on examples, for more information about jQuery animation effects, see the following examples. We will share this with you for your reference. The details are as follows:
1. show () Display Effect
Synt
identical selectors you have written in the project again and again. Each $ ('. element') must query the entire DOM once, whether or not it has been executed like this. Instead, we only run the selector once and store the result in a variable:
var blocks = $('#blocks').find('li');
Now you can use the blocks variable anywhere without having to query the DOM every time:
$('#hideBlocks').click(function () {blocks.fadeOut();});$('#showBlocks').click(function () {blocks.fadeIn();});
Cached
jquery is a same as prototype excellent JS development Library class, especially for CSS and XPath support, so that we write JS become more convenient! If you are not a JS master and want to write excellent JS effect, jquery can help you achieve the goal!
. Hide ()
Hides the matching element.
. Hide ()
This method does not accept any arguments.
. Hide ([Duration][,complete])Duration
A string or number
underneath.
Useful and practical jquery image tooltips tutorial | demoIn this tutorial, we will learn how to create a thumbnail image tooltip with jquery. it displays a tooltip image when user hover on the thumbnail with fadein and out effect. it's a useful script for your website.
Create background scrolling effect with
/** Jquery blockui plugin* Version 2.16 (20-Mar-2009)* @ Requires jquery v1.2.3 or later** Examples at: http://malsup.com/jquery/block/* Copyright (c) 2007-2008 M. alsup* Dual licensed under the MIT and GPL licenses:* Http://www.opensource.org/licenses/mit-license.php* Http://www.gnu.org/licenses/gpl.html** Thanks to Amir-Hossein Sobhi for some excellent contribu
can be "slow", "fast", or millisecond.
The optional callback parameter is the name of the function executed after the toggle () method is complete.
(2) jquery allows you to fade in and out elements.
Jquery fadein () shows hidden elements.
Syntax:
$(selector).fadeIn(speed,callback);
The optional speed parameter specif
be hidden. toggle (speed), its size (length and width) and transparency will change gradually. ImgSrc= "1.jpg"Style= "Width: 150px"/>AHref= "#"OnClick= '$ ("Img"). toggle ("slow ")'>JQuery
A>FadeIn (speeds) fadeOut (speeds)Adjust the transparency based on the speed to display or hide matching objects. Note that, unlike hide (speed) and show (speed), fadeIn and
In this article, we'll cover 15 tips to make your jquery more effective, most of which are about performance improvements, and hopefully you'll enjoy it!1. Try to use the latest version of the jquery class libraryA lot of innovation was used in the jquery project. The best way to improve performance is to use the latest version of
callback parameter is the name of the function executed after it is hidden or displayed.6.2-functions for displaying and hiding two actions:$ (Selector). toggle (speed, callback );The optional speed parameter specifies the hidden/display speed. The value can be "slow", "fast", or millisecond.The optional callback parameter is the name of the function executed after the toggle () method is complete.6.3-switching functions for fade-in, fade-out, and fade-in and fade-out;$ (Selector).
event handler function
Event.target Event-oriented page element
Event.preventdefault () blocks the default behavior of an event (for example, clicking a link will automatically open a new page)
Event.stoppropagation () Stop event bubbling to upper element
In the event handler function, you can use the This keyword to return the DOM element for the event:
$ (' a '). Click (function () {if ($ (this). attr (' href '). Match (' evil ') {//if identified as a harmful lin
Good code can lead to speed improvements. Fast rendering and responsiveness means a better user experience.First, keep in mind that jquery is JavaScript. This means that we should take the same coding conventions, style guides and best practices.First of all, if you're a novice JavaScript, I suggest you read the 24 best practices for JavaScript beginners , a high-quality JavaScript tutorial that you'd better read before contacting jquery.When you are
right corner of the transparent background layer (div or ul --> li)
7. Of course, sometimes there are still two arrows at both ends of the image
As a result, the html structure can be constructed first.
The alt description of the image part is the information content of the infoList part. In some cases, you can bind it to the hidden directory. It should be noted that the width and height of the image in imgList are set immediately. If they are set in css, they will be slower.
I add the corres
the class selector is the slowest selector; in IE it loops through the DOM. Try to avoid using it if possible. Do not add tags in front of the ID. For example, it will go through all the
var content = $ (' div#content ');
In the same way, it is redundant to pass multiple IDs.
var traffic_light = $ (' #content #traffic_light ');
3. Caching jquery objects
Get into the habit of keeping jq
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.