Common plugins under JQ

Source: Internet
Author: User

Plug-in Overview: plug-ins are based on the core code of JQuery , writing a composite of certain specifications of the application. In other words, the plug-in is also jQuery code, through The introduction of JS files can be implanted.

There are many kinds of plug-ins, up to thousands of kinds, mainly can be divided into:UI class, forms and validation classes, input classes, special effects classes,Ajax class, sliding class, graphic image class, navigation class, comprehensive tools, animation and so on.

How do I refer to plugins?

The introduction of plug-ins requires a certain amount of steps, basically as follows:

1. The Jquery.js file must first be introduced and introduced before all plugins;

2. introduction of plugins;

3. introduce the peripheral of the plug-in, such as skin, Chinese bag, etc.

Plugin Note:

jQuery files must be introduced first

Then introduce the jQuery plugin file

Form verification Plugin Validate plug-in usage

How is it implemented?

Get the form, call the Validate (options) method to verify

The method receives the options option

{

Rules: {//set validation rules

Key:value

Key-the Name property value of the form element

Value-Validation rule name

},

Messages: {//Set error message

Key:value

Key-the Name property value of the form element

Value-Set error message

}

}

By customizing validation rules

$.validator.addmethod (Name,method,message)

* Name-Set the name of the custom validation rule

* Method-is a function

function (Value,element,param) {}

* Value-values of the element (validates the value of the current element)

* element-The elements themselves (validates the current element)

* param-parameters (value values in rules)

* Message-Set the error message for the custom validation rule

Common plugins under JQ

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.