Getting started with jQuery dummies

Source: Internet
Author: User
This article is intended for students who do not understand JS and only use HTML and CSS! This site is an example that will bypass Javascript. This article is too idiotic for you; it will not bypass HTML and CSS, and you may not understand the following content. (It is better to have a bit of English, or it will be very troublesome) What is jQuery? JQuery is a JavaScript library, which is interpreted as a JavaScript library by an idiot.

This article is intended for students who do not understand JS and only use HTML and CSS! This site is an example

This article is too idiotic for you. If HTML and CSS are not, you may not understand the following content. (It is better to have a little bit of English, or it will be very troublesome)

What is jQuery?
JQuery is a JavaScript library, and an idiot's explanation is a JavaScript toolbox. There are many ready-made tools that can be used for whatever you want. Saving the trouble of re-writing code, it is easier to get started with JavaScript idiots like me.

What can jQuery do?
It can make your page have a lot of amazing dynamic effects. Simply put, it is to make your website more beautiful. There are many different effects here. Click here to view >>>

How to Use jQuery?
Simply put: by calling the jQuery Library (a js file) on the page, you can easily use the tool (another js is required to call the tool in jQuery ), to achieve the desired effect.

Step 1: Find the desired effect
The effects of this site are from two aspects: sonicHTML and jQuerytools. There are more results on the network. If you are willing to spend time, you can look elsewhere.

Step 2: code extraction
First, we recommend Firefox + firebug, a powerful code tool. If not, hurry up! Be very careful with the code!

1. html and css in static pages

Use firebug to obtain the HTML and CSS code you want on the page. Do not change the id and class of this part!

At the same time, there may be an empty result before the HTML element you want, such as the result >>>. Never miss it!

2.In js

(1) In the called js, there will certainly be a js file name with "jQuery", directly copying the code of this file into your own file.

(2) InThere must be another js, which contains the following code:

$ (Document). ready (function (){

// Other code is in the middle

});
This js may be an external file called, or it may also appear in the head (body, but it is less likely) in the form of script and script. In this part, the id or class in the HTML is displayed. Be sure to keep them consistent. If you want to use other names, you must remember to synchronize them in HTML and js. If they are different, you will lose money.

Step 3: test locally and modify errors
Create HTML, CSS, and JS locally and put all the code obtained. All the called files are called. The exciting time has come! Open a static page in a browser to check whether the page works. If this happens, congratulations! Go to the next step and transform it into your own things! If not, check carefully:

(1) Possible Errors in HTML:

① You modified the id or class in HTML [solution: change back to the original]

② Blank ones are missing. [solution: Check the HTML you have extracted to see if there are any blank ones. If so, add them and try again]

(2) Possible Errors in JS:

① Call path error [solution: change to a valid call path and put js and HTML together for the most convenient operation]

② This js (which may be an external file or the code in the head) is missing (solution: Find the Code with ready on the original static page, copy and add]

③ The id or class in ready is inconsistent with that in HTML. [solution: Find the corresponding link in the original HTML and js and change it to the same]

Step 4: Modify HTML and css to become your own things
There is no fixed method in this step. You can modify the method if you want to modify it. But pay attention to the id and class in HTML to correspond to js!

Step 5: add to your own page
This is basically nothing to say, but I still want to say to the wp users: external file calls are all in the header in the topic folder. php (I have been searching for it for half a day ~~~~)

Related Article

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.